Package org.datanucleus
Class BeanValidationHandler
- java.lang.Object
-
- org.datanucleus.BeanValidationHandler
-
public class BeanValidationHandler extends java.lang.ObjectHandles the integration of "javax.validation" Bean Validation API (JSR 303). Note that this is the only class referring to BeanValidation classes so that it is usable in environments without BeanValidation present.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classBeanValidationHandler.PersistenceTraversalResolverResolver for traversal of validation.
-
Field Summary
Fields Modifier and Type Field Description (package private) ClassLoaderResolverclr(package private) Configurationconf(package private) javax.validation.Validatorvalidator
-
Constructor Summary
Constructors Constructor Description BeanValidationHandler(ExecutionContext ec, java.lang.Object validatorFactory)Constructor for a validation handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()private java.lang.Class<?>[]getGroups(java.lang.String property, java.lang.String eventName)Parse comma separated string of class names and return a corresponding array of classesvoidpreDelete(java.lang.Object pc)voidprePersist(java.lang.Object pc)voidpreStore(java.lang.Object pc)voidvalidate(java.lang.Object pc, java.lang.String callbackName, java.lang.Class<?>[] groups)Validate the constraints of an object
-
-
-
Field Detail
-
validator
javax.validation.Validator validator
-
clr
ClassLoaderResolver clr
-
conf
Configuration conf
-
-
Constructor Detail
-
BeanValidationHandler
public BeanValidationHandler(ExecutionContext ec, java.lang.Object validatorFactory)
Constructor for a validation handler.- Parameters:
ec- ExecutionContext that we are persisting invalidatorFactory- Validation factory
-
-
Method Detail
-
close
public void close()
-
validate
public void validate(java.lang.Object pc, java.lang.String callbackName, java.lang.Class<?>[] groups)Validate the constraints of an object- Parameters:
pc- the objectcallbackName- Name of the callbackgroups- the validation groups
-
preDelete
public void preDelete(java.lang.Object pc)
-
preStore
public void preStore(java.lang.Object pc)
-
prePersist
public void prePersist(java.lang.Object pc)
-
getGroups
private java.lang.Class<?>[] getGroups(java.lang.String property, java.lang.String eventName)Parse comma separated string of class names and return a corresponding array of classes- Parameters:
property- the string with comma separated class names- Returns:
- The groups
-
-