com.atlassian.validation
Interface Validator.Result

All Known Implementing Classes:
Failure, Success
Enclosing interface:
Validator

public static interface Validator.Result

Post-validation state. Enables access to the value object and failure case details like error messages.


Method Summary
 String get()
          If valid returns the value in string form.
 String getErrorMessage()
          If validation failed, the reason is found here in plain text.
 String getErrorMessageHtml()
          If validation failed, the reason is found here in html.
 boolean isValid()
          Whether the validation succeeded.
 

Method Detail

isValid

boolean isValid()
Whether the validation succeeded.

Returns:
true only if validaiton was successful.

getErrorMessage

String getErrorMessage()
If validation failed, the reason is found here in plain text.

Returns:
the error message if any, or null if validation succeeded.

getErrorMessageHtml

String getErrorMessageHtml()
If validation failed, the reason is found here in html.

Returns:
the error message if any, or null if validation succeeded.

get

String get()
           throws IllegalStateException
If valid returns the value in string form.

Returns:
the value.
Throws:
IllegalStateException - if the result is not valid.


Copyright © 2002-2013 Atlassian. All Rights Reserved.