| org.iscreen.ValidationService
All known Subclasses: org.iscreen.ValidationServiceWrapper, org.iscreen.impl.BaseValidationService,
ValidationService | public interface ValidationService (Code) | | This interface represents the main entry point for performing
validations.
A note about exceptions:
The interface is designed to be used so that checked exceptions are
thrown when a validation failure (or warning) occurs. The debate about
checked versus unchecked exceptions is a long and heated one, but it is
the author's opinion that checked exceptions (in this case, at least) are
the more appropriate approach. However, realizing that a framework may
be used in different ways, and not wishing to force a particular opinion
on developers, the validateObject() methods were added to support
unchecked exceptions. However, there is a known issue with these methods
and the unchecked exception this they throw: these interfaces are mere
copies on top of the checked exceptions calls (i.e. convenience methods),
and as such, will lose the original root exception (and, hence, the
original stack trace). Under normal circumstances, this isn't an issue
(since your users shouldn't care), but it does cause issues for
developers trying to debug. Hence, the "contained" checked exception
can be retrieved from the unchecked exception's API for debugging purposes.
author: Shellman, Dan |
Method Summary | |
DocumentationIterator | getDocumentation() Retrieves an iterator of String values representing the documentation
configured for this validation service (the underlying validation set). | String | getServiceName() The service name (unique id) of the service. | void | validate(Object obj) Called to validate an object (typically a JavaBean). | void | validate(Object obj, Locale locale) Called to validate an object (typically a JavaBean). | void | validateObject(Object obj) Identical to validate() except that it throws the unchecked exception
ObjectValidationException instead of a checked exception. | void | validateObject(Object obj, Locale locale) Identical to validate() except that it throws the unchecked exception
ObjectValidationException instead of a checked exception. |
getDocumentation | DocumentationIterator getDocumentation()(Code) | | Retrieves an iterator of String values representing the documentation
configured for this validation service (the underlying validation set).
Returns an iterator of Strings representing documentation. |
getServiceName | String getServiceName()(Code) | | The service name (unique id) of the service. This is the fully
qualified name of the Validation Set that this service represents.
Returns the unique service name/id of this service. |
validate | void validate(Object obj) throws ValidationException(Code) | | Called to validate an object (typically a JavaBean). If the
object passes validation, nothing occurs (there should be no
side-effects). If one or more Validators find one or more
validation failures, then an exception will be thrown containing
all validations failures found.
Parameters: obj - The object (usually a JavaBean) to validate. exception: ValidationException - The exception containing anyvalidation failures. |
validate | void validate(Object obj, Locale locale) throws ValidationException(Code) | | Called to validate an object (typically a JavaBean). If the
object passes validation, nothing occurs (there should be no
side-effects). If one or more Validators find one or more
validation failures, then an exception will be thrown containing
all validations failures found.
Parameters: obj - The object (usually a JavaBean) to validate. Parameters: locale - The locale used for failure message generation. exception: ValidationException - The exception containing anyvalidation failures. |
validateObject | void validateObject(Object obj)(Code) | | Identical to validate() except that it throws the unchecked exception
ObjectValidationException instead of a checked exception.
Parameters: obj - The object (usually a JavaBean) to validate. exception: ObjectValidationException - The exception containing anyvalidation failures. |
validateObject | void validateObject(Object obj, Locale locale)(Code) | | Identical to validate() except that it throws the unchecked exception
ObjectValidationException instead of a checked exception.
Parameters: obj - The object (usually a JavaBean) to validate. Parameters: locale - The locale used for failure message generation. exception: ObjectValidationException - The exception containing anyvalidation failures. |
|
|