| |
|
| java.lang.Object java.lang.Throwable java.lang.Exception org.iscreen.ValidationException
ValidationException | public class ValidationException extends Exception (Code) | | When a validation failure occurs, eventually a ValidationException is
thrown to the caller. This is a checked exception that should be
handled by the caller. The exception contains the list of ValidationFailures
that represent the validations that have failed. Ultimately, the failures
should be used to notify the end user (or system).
author: Shellman, Dan |
Constructor Summary | |
public | ValidationException() Default constructor with no pre-defined validation failures. | public | ValidationException(List validationFailures) Constructor with pre-defined validation failures. | public | ValidationException(List validationFailures, List validationWarnings) Constructor with pre-defined validation failures and warnings. |
Method Summary | |
public void | addFailure(ValidationFailure failure) Add a failure to this exception. | public void | addWarning(ValidationFailure warning) Add a warning to this exception. | public List | getFailureMessages() Retrieves the list of failure messages (List of String objects). | public List | getFailures() Retrieves the List of ValidationFailures associated with this exception
that represent the failures. | public List | getNamedFailures(String validatorName) Retrieves the List of failures (and warnings) that are associated with
a particular "name." The name is defined in the configuration, and is
associated with a particular use of a validator. | public List | getWarningMessages() Retrieves the list of warning messages (List of String objects). | public List | getWarnings() Retrieves the List of ValidationFailures associated with this exception
that represent the warnings. |
namedFailures | protected Map namedFailures(Code) | | |
ValidationException | public ValidationException()(Code) | | Default constructor with no pre-defined validation failures.
|
ValidationException | public ValidationException(List validationFailures)(Code) | | Constructor with pre-defined validation failures.
Parameters: validationFailures - The List of ValidationFailures for this exception. |
ValidationException | public ValidationException(List validationFailures, List validationWarnings)(Code) | | Constructor with pre-defined validation failures and warnings. Each
List must contain ValidationFailure objects.
Parameters: validationFailures - The List of failures for this exception. Parameters: validationWarnings - The List of warnings for this exception. |
addFailure | public void addFailure(ValidationFailure failure)(Code) | | Add a failure to this exception. This failure will be appended
to the end of the internal list of failures.
Parameters: failure - The ValidationFailure to add to this exception. |
addWarning | public void addWarning(ValidationFailure warning)(Code) | | Add a warning to this exception. This warning will be appended
to the end of the internal list of warnings.
Parameters: warning - The warning to add to this exception. |
getFailureMessages | public List getFailureMessages()(Code) | | Retrieves the list of failure messages (List of String objects).
Returns the List of failure messages (as Strings). |
getFailures | public List getFailures()(Code) | | Retrieves the List of ValidationFailures associated with this exception
that represent the failures.
Returns a List of ValidationFailures. |
getNamedFailures | public List getNamedFailures(String validatorName)(Code) | | Retrieves the List of failures (and warnings) that are associated with
a particular "name." The name is defined in the configuration, and is
associated with a particular use of a validator. This is interesting
when mapping back to some form of presentation layer.
Parameters: validatorName - The name to find failures against. Returns a List of ValidationFailure objects (or an emptyList if there are none associated with the given name).Will not return null. |
getWarningMessages | public List getWarningMessages()(Code) | | Retrieves the list of warning messages (List of String objects).
Returns the List of warning messages (as Strings). |
getWarnings | public List getWarnings()(Code) | | Retrieves the List of ValidationFailures associated with this exception
that represent the warnings.
Returns a List of warnings. |
|
|
|