org.apache.openjpa.persistence.validation
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 javax.validation
packages, which should only occur in the ValidatorImpl class.
- Version:
- $Rev$ $Date$
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValidationUtils
public ValidationUtils()
setupValidation
public static boolean setupValidation(OpenJPAConfiguration conf)
- Setup Validation support by determining if the javax.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
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.