Package org.apache.openjpa.validation
Interface Validator
-
- All Known Implementing Classes:
AbstractValidator,ValidatorImpl
public interface ValidatorBasic validation interface which defines the contract for event based validation. Event values are defined in LifeCycleEvent.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> ValidationExceptionvalidate(T arg0, int event)Validates a given instance<T> ValidationExceptionvalidateProperty(T arg0, java.lang.String property, int event)Validates a property of a given instance<T> ValidationExceptionvalidateValue(java.lang.Class<T> arg0, java.lang.String arg1, java.lang.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 Detail
-
validate
<T> ValidationException validate(T arg0, int event)
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
<T> ValidationException validateProperty(T arg0, java.lang.String property, int event)
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
<T> ValidationException validateValue(java.lang.Class<T> arg0, java.lang.String arg1, java.lang.Object arg2, int event)
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
-
-