Class ValidationUtils


  • public class ValidationUtils
    extends java.lang.Object
    Validation helper routines and wrappers to remove runtime dependencies on the Bean Valdiation APIs or a implementation. Note: This class should have no direct dependency on the jakarta.validation packages, which should only occur in the ValidatorImpl class.
    Version:
    $Rev$ $Date$
    • Constructor Summary

      Constructors 
      Constructor Description
      ValidationUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isConstraintViolationException​(java.lang.Exception e)
      Determines whether an exception is a constraint violation exception via class name.
      static boolean setupValidation​(OpenJPAConfiguration conf)
      Setup Validation support by determining if the jakarta.validation APIs are available and then create a Validator if required by the provided configuration.
      • Methods inherited from class java.lang.Object

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

      • ValidationUtils

        public ValidationUtils()
    • Method Detail

      • setupValidation

        public static boolean setupValidation​(OpenJPAConfiguration conf)
        Setup Validation support by determining if the jakarta.validation APIs are available and then create a Validator if required by the provided configuration.
        Parameters:
        conf -
        Returns:
        true if a Validator was created, false otherwise.
        Throws:
        If - a Validator was required but could not be created.
      • isConstraintViolationException

        public static boolean isConstraintViolationException​(java.lang.Exception e)
        Determines whether an exception is a constraint violation exception via class name. Does not require JSR-303 API to be in classpath.
        Parameters:
        e - exception to check
        Returns:
        true of the exception is a constraint violation exception