public class ValidatorService
extends java.lang.Object
The ValidatorService
class provides ability
to take an object and the Validator associated with it and
validate all the fields in the object and return the list
of errors in the Object's state
Modifier and Type | Method and Description |
---|---|
static ValidatorService |
getInstance()
This will retrieve the singleton instance of this class, allowing
it to be used across applications.
|
ValidatorResult |
validateObject(java.lang.Object validateIn)
Take an validatable object and check if its fields are in a valid
state or not.
|
ValidatorResult |
validateObject(java.lang.Object validateIn,
Validator validatorIn)
Take an validatable object and check if its fields are in a valid
state or not
If in the future we want to remove the dependancy on Struts we
need to write a class that duplicates ValidatorError.
|
ValidatorResult |
validateObject(java.lang.Object validateIn,
Validator validatorIn,
java.util.List constraintNames)
Take an validatable object and check if its fields are in a valid
state or not
If in the future we want to remove the dependancy on Struts we
need to write a class that duplicates ValidatorError.
|
public static ValidatorService getInstance()
This will retrieve the singleton instance of this class, allowing it to be used across applications.
ValidatorService
- the singleton instance to use.public ValidatorResult validateObject(java.lang.Object validateIn, Validator validatorIn)
validateIn
- A validatable object to be checkedvalidatorIn
- The Validator instance to use with this object.public ValidatorResult validateObject(java.lang.Object validateIn, Validator validatorIn, java.util.List constraintNames)
validateIn
- A validatable object to be checkedvalidatorIn
- The Validator instance to use with this object.constraintNames
- List of constraints to validatepublic ValidatorResult validateObject(java.lang.Object validateIn)
validateIn
- A validatable object to be checked