Package org.apache.openjpa.validation
Class AbstractValidator
java.lang.Object
org.apache.openjpa.validation.AbstractValidator
- All Implemented Interfaces:
Validator
- Direct Known Subclasses:
ValidatorImpl
Abstract validation class which provides base validation methods.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract <T> ValidationException
validate
(T arg0, int event) Validates a given instanceabstract <T> ValidationException
validateProperty
(T arg0, String property, int event) Validates a property of a given instanceabstract <T> ValidationException
validateValue
(Class<T> arg0, String arg1, Object arg2, int event) Validates a value based upon the constraints applied to a given class attribute.<T> boolean
validating
(T arg0, int event) Method for determining whether validation is active for the given type and event.
-
Constructor Details
-
AbstractValidator
public AbstractValidator()
-
-
Method Details
-
validate
Description copied from interface:Validator
Validates a given instance -
validateProperty
Description copied from interface:Validator
Validates a property of a given instance- Specified by:
validateProperty
in interfaceValidator
- Type Parameters:
T
- The instance to validate- Parameters:
arg0
- The class, of type T to validateproperty
- The property to validateevent
- The event id- Returns:
- ValidationException if the validator produces one or more constraint violations.
-
validateValue
public abstract <T> ValidationException validateValue(Class<T> arg0, String arg1, Object arg2, int event) Description copied from interface:Validator
Validates a value based upon the constraints applied to a given class attribute.- Specified by:
validateValue
in interfaceValidator
- Type Parameters:
T
- The instance type to base validation upon- Parameters:
arg0
- The class of type T to validatearg1
- The property to validatearg2
- The property value to validateevent
- The event id- Returns:
- ValidationException if the validator produces one or more constraint violations.
-
validating
public <T> boolean validating(T arg0, int event) Description copied from interface:Validator
Method for determining whether validation is active for the given type and event.- Specified by:
validating
in interfaceValidator
- Parameters:
arg0
- Type being validatedevent
- event type- Returns:
- true if validation is active for the specified event
-