public class ValidationXMLReader
extends java.lang.Object
implements java.util.concurrent.Callable<java.util.Map<java.lang.Class<?>,java.lang.Boolean>>
Strategy:
1. Parse validation.xml, looking for a constraints-file reference.
2. For each reference, if file is found, parses the constraints file and puts all classes declared under
<bean class="clazz"> into
BeanValidationHelper.constraintsOnClasses
with value Boolean.TRUE
.
This class contains resources-burdening instance fields (e.g. SAXParser) and as such was designed to be instantiated
once (make the instance BOUNDED) and have call()
method called on that instance once.
Not suitable for singleton (memory burden). The method #parse() will be invoked only once per class load of this class. After that the instance and all its fields should be made collectible by GC.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BEAN_QNAME |
static java.lang.String |
CLASS_QNAME |
static java.lang.String |
CONSTRAINT_MAPPING_QNAME |
static java.lang.String |
DEFAULT_PACKAGE_QNAME |
static java.lang.String |
PACKAGE_SEPARATOR |
Constructor and Description |
---|
ValidationXMLReader() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.Class<?>,java.lang.Boolean> |
call()
Parses validation.xml.
|
static boolean |
isValidationXmlPresent()
Checks if validation.xml exists.
|
public static final java.lang.String DEFAULT_PACKAGE_QNAME
public static final java.lang.String BEAN_QNAME
public static final java.lang.String CONSTRAINT_MAPPING_QNAME
public static final java.lang.String CLASS_QNAME
public static final java.lang.String PACKAGE_SEPARATOR
public java.util.Map<java.lang.Class<?>,java.lang.Boolean> call() throws java.lang.Exception
call
in interface java.util.concurrent.Callable<java.util.Map<java.lang.Class<?>,java.lang.Boolean>>
java.lang.Exception
public static boolean isValidationXmlPresent()