Class BeanValidationHandler


  • public class BeanValidationHandler
    extends java.lang.Object
    Handles 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      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
      void preDelete​(java.lang.Object pc)  
      void prePersist​(java.lang.Object pc)  
      void preStore​(java.lang.Object pc)  
      void validate​(java.lang.Object pc, java.lang.String callbackName, java.lang.Class<?>[] groups)
      Validate the constraints of an object
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BeanValidationHandler

        public BeanValidationHandler​(ExecutionContext ec,
                                     java.lang.Object validatorFactory)
        Constructor for a validation handler.
        Parameters:
        ec - ExecutionContext that we are persisting in
        validatorFactory - 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 object
        callbackName - Name of the callback
        groups - 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