Class ValidationUtils
- java.lang.Object
-
- org.apache.openjpa.persistence.validation.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.
-
-
-
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
-
-