Class ValidationUtils

java.lang.Object
org.apache.openjpa.persistence.validation.ValidationUtils

public class ValidationUtils extends 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 Details

    • ValidationUtils

      public ValidationUtils()
  • Method Details

    • 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(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