Package org.apache.openjpa.validation
Interface Validator
- All Known Implementing Classes:
AbstractValidator,ValidatorImpl
public interface Validator
Basic validation interface which defines the contract for
event based validation. Event values are defined in LifeCycleEvent.
-
Method Summary
Modifier and TypeMethodDescriptionvalidate(T arg0, int event) Validates a given instancevalidateProperty(T arg0, String property, int event) Validates a property of a given instancevalidateValue(Class<T> arg0, String arg1, Object arg2, int event) Validates a value based upon the constraints applied to a given class attribute.<T> booleanvalidating(T arg0, int event) Method for determining whether validation is active for the given type and event.
-
Method Details
-
validate
Validates a given instance- Type Parameters:
T- The instance to validate- Parameters:
arg0- The class, of type T to validateevent- The event id- Returns:
- ValidationException if the validator produces one or more constraint violations.
-
validateProperty
Validates a property of a given instance- 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
Validates a value based upon the constraints applied to a given class attribute.- 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
<T> boolean validating(T arg0, int event) Method for determining whether validation is active for the given type and event.- Type Parameters:
T-- Parameters:
arg0- Type being validatedevent- event type- Returns:
- true if validation is active for the specified event
-