|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.validation.AbstractValidator org.apache.openjpa.persistence.validation.ValidatorImpl
public class ValidatorImpl
Constructor Summary | |
---|---|
ValidatorImpl()
Default constructor. |
|
ValidatorImpl(Configuration conf)
|
|
ValidatorImpl(ValidatorFactory validatorFactory,
ValidationMode mode)
Type-specific constructor Returns an Exception if a Validator could not be created. |
Method Summary | ||
---|---|---|
void |
addValidationGroup(Integer event,
Class<?>... validationGroup)
Add a validation group for a specified event. |
|
void |
addValidationGroup(String validationGroupName,
Class<?>... vgs)
Add a validation group for the specific property. |
|
void |
addValidationGroup(String validationGroupName,
String group)
Add the validation group(s) for the specified event. |
|
BeanDescriptor |
getConstraintsForClass(Class<?> cls)
Returns the validation constraints for the specified class |
|
Class<?>[] |
getValidationGroup(Integer event)
Return the validation groups to be validated for a specified event |
|
boolean |
isValidating(Integer event)
Returns whether the Validator is validating for the specified event. |
|
|
validate(T arg0,
int event)
Validates a given instance |
|
|
validateProperty(T arg0,
String property,
int event)
Validates a property of a given instance |
|
|
validateValue(Class<T> arg0,
String arg1,
Object arg2,
int event)
Validates a value based upon the constraints applied to a given class attribute. |
|
|
validating(T arg0,
int event)
Returns whether validation is active for the given event. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValidatorImpl()
public ValidatorImpl(Configuration conf)
public ValidatorImpl(ValidatorFactory validatorFactory, ValidationMode mode)
validatorFactory
- Instance of validator factory to use. Specify
null to use the default factory.mode
- ValdiationMode enum valueMethod Detail |
---|
public void addValidationGroup(String validationGroupName, Class<?>... vgs)
validationGroupName
- vgs
- public void addValidationGroup(Integer event, Class<?>... validationGroup)
event
- validationGroup
- public void addValidationGroup(String validationGroupName, String group)
event
- group
- public Class<?>[] getValidationGroup(Integer event)
event
- Lifecycle event id
public boolean isValidating(Integer event)
event
- the event to check for validation
public BeanDescriptor getConstraintsForClass(Class<?> cls)
cls
- Class for which constraints to return
public <T> ValidationException validate(T arg0, int event)
validate
in interface Validator
validate
in class AbstractValidator
T
- The instance to validatearg0
- The class, of type T to validateevent
- The event id
public <T> ValidationException validateProperty(T arg0, String property, int event)
validateProperty
in interface Validator
validateProperty
in class AbstractValidator
T
- The instance to validatearg0
- The property to validateproperty
- The property to validateevent
- The event id
public <T> ValidationException validateValue(Class<T> arg0, String arg1, Object arg2, int event)
validateValue
in interface Validator
validateValue
in class AbstractValidator
T
- The instance type to base validation uponarg0
- The class of type T to validatearg1
- The property to validatearg2
- The property value to validateevent
- The event id
public <T> boolean validating(T arg0, int event)
validating
in interface Validator
validating
in class AbstractValidator
T
- arg0
- Type being validatedevent
- event type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |