|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springmodules.validation.bean.conf.loader.xml.handler.AbstractClassValidationElementHandler
public abstract class AbstractClassValidationElementHandler
A base class for common PropertyValidationElementHandler
implementations that represent validation rules. This base handler idetifies the supported elements by their
tag names (qualified and local). In addition, it assumes the following common attributes:
ConditionExpressionParser that is associated with this handler. It
uses ValangConditionExpressionParser by default.
| Constructor Summary | |
|---|---|
AbstractClassValidationElementHandler(java.lang.String elementName)
Constructs a new AbstractPropertyValidationElementHandler with given supported element name. |
|
AbstractClassValidationElementHandler(java.lang.String elementName,
java.lang.String namespace)
Constructs a new AbstractPropertyValidationElementHandler with given supported element name and namespace. |
|
AbstractClassValidationElementHandler(java.lang.String elementName,
java.lang.String namespace,
ConditionExpressionParser conditionExpressionParser,
FunctionExpressionParser functionExpressionParser)
Constructs a new AbstractPropertyValidationElementHandler with given supported element name and namespace and a condition handler to parse the apply-if expressions. |
|
| Method Summary | |
|---|---|
protected abstract AbstractValidationRule |
createValidationRule(org.w3c.dom.Element element)
Creates the validation rule represented and initialized by and with the given element. |
protected Condition |
extractApplicabilityCondition(org.w3c.dom.Element element)
Extracts the validation rule applicability condition from the given element. |
protected ErrorArgumentsResolver |
extractArgumentsResolver(org.w3c.dom.Element element)
Extracts the validation rule error arguments from the given element. |
protected java.lang.String |
extractErrorCode(org.w3c.dom.Element element)
Extracts the validation rule error code from the given element. |
protected java.lang.String |
extractMessage(org.w3c.dom.Element element)
Extracts the validation rule error message from the given element. |
protected ConditionExpressionParser |
getConditionExpressionParser()
Returns the condition expression parser associated with this handler. |
protected FunctionExpressionParser |
getFunctionExpressionParser()
Returns the FunctionExpressionParser used by this handler to parse the error argument expressions. |
void |
handle(org.w3c.dom.Element element,
MutableBeanValidationConfiguration configuration)
Creates the appropriate ValidationRule based on the given element
and adds it to the given configuration. |
boolean |
isConditionGloballyScoped()
By default the element handlers handle and produce rules that can be associated with both global and non-global contexts. |
protected boolean |
isNullSupported()
Indicates whether the validation rule supports null values. |
void |
setConditionExpressionParser(ConditionExpressionParser conditionExpressionParser)
Sets the condition expression parser to be used when parsing the condition expression. |
void |
setFunctionExpressionParser(FunctionExpressionParser functionExpressionParser)
Sets the function expression parser to be used when parsing the function expressions. |
boolean |
supports(org.w3c.dom.Element element,
java.lang.Class clazz)
Determines whether the given element is supported by this handler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractClassValidationElementHandler(java.lang.String elementName)
elementName - The supported element name.
public AbstractClassValidationElementHandler(java.lang.String elementName,
java.lang.String namespace)
elementName - The supported element name.namespace - The supported namespace.
public AbstractClassValidationElementHandler(java.lang.String elementName,
java.lang.String namespace,
ConditionExpressionParser conditionExpressionParser,
FunctionExpressionParser functionExpressionParser)
apply-if expressions.
elementName - The supported element name.namespace - The supported namespace.conditionExpressionParser - The condition expression parser to be used to parse the various condition expressions.functionExpressionParser - The function expression parser to be used to parse the error arguments expressions.| Method Detail |
|---|
public boolean supports(org.w3c.dom.Element element,
java.lang.Class clazz)
supports in interface ClassValidationElementHandlerelement - The element to be handled.clazz - The validated class.
true if this handler can handle the given element, false otherwise.PropertyValidationElementHandler.supports(org.w3c.dom.Element, Class, java.beans.PropertyDescriptor)
public void handle(org.w3c.dom.Element element,
MutableBeanValidationConfiguration configuration)
ValidationRule based on the given element
and adds it to the given configuration.
handle in interface ClassValidationElementHandlerelement - The element to be handled.configuration - The configuration to be manipulated.handle(org.w3c.dom.Element, org.springmodules.validation.bean.conf.MutableBeanValidationConfiguration)public boolean isConditionGloballyScoped()
protected java.lang.String extractErrorCode(org.w3c.dom.Element element)
null.
element - The element that represents the validation rule.
protected java.lang.String extractMessage(org.w3c.dom.Element element)
null instead.
element - The element that represents the validation rule.
protected ErrorArgumentsResolver extractArgumentsResolver(org.w3c.dom.Element element)
null.
element - The element that represents the validation rule.
protected Condition extractApplicabilityCondition(org.w3c.dom.Element element)
null.
element - The element that represents the validation rule.
public void setConditionExpressionParser(ConditionExpressionParser conditionExpressionParser)
ConditionExpressionBased
setConditionExpressionParser in interface ConditionExpressionBasedconditionExpressionParser - The condition expression parser to be used.ConditionExpressionBased.setConditionExpressionParser(org.springmodules.validation.util.cel.ConditionExpressionParser)protected ConditionExpressionParser getConditionExpressionParser()
public void setFunctionExpressionParser(FunctionExpressionParser functionExpressionParser)
FunctionExpressionBased
setFunctionExpressionParser in interface FunctionExpressionBasedfunctionExpressionParser - The function expression parser to be used.FunctionExpressionBased.setFunctionExpressionParser(org.springmodules.validation.util.fel.FunctionExpressionParser)protected FunctionExpressionParser getFunctionExpressionParser()
FunctionExpressionParser used by this handler to parse the error argument expressions.
FunctionExpressionParser used by this handler to parse the error argument expressions.protected boolean isNullSupported()
true if the validation rule support null values, false otherwise.protected abstract AbstractValidationRule createValidationRule(org.w3c.dom.Element element)
element - The element that represents the validation rule.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||