|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.milyn.validation.Validator
public final class Validator
A Validator uses a predefined Rule that performs the actual validator for a Validator. This way a Validator does not know about the technology used for the validation and users can mix and max different rules as appropriate to the use case they have. For example, one problem might be solve nicely with a regular expression but another might be easier to sovle using a MVEL expression. Example configuration:
<rules:ruleBases>
<rules:ruleBase name="addressing" src="usa_address.properties" provider="org.milyn.smooks.validation.RegexProvider" />
</rules:ruleBases>
<validation:field on="order/header/email" rule="addressing.email" onFail="WARN" />
Options:
| Constructor Summary | |
|---|---|
Validator()
No-args constructor required by Smooks. |
|
Validator(java.lang.String compositRuleName,
OnFail onFail)
Public constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
getCompositRuleName()
|
OnFail |
getOnFail()
|
void |
initialize()
Initialize the visitor instance. |
Validator |
setAppContext(ApplicationContext appContext)
|
void |
setCompositRuleName(java.lang.String compositRuleName)
|
void |
setOnFail(OnFail onFail)
|
java.lang.String |
toString()
|
void |
visitAfter(org.w3c.dom.Element element,
ExecutionContext executionContext)
|
void |
visitAfter(SAXElement element,
ExecutionContext executionContext)
|
void |
visitBefore(SAXElement element,
ExecutionContext executionContext)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Validator()
public Validator(java.lang.String compositRuleName,
OnFail onFail)
compositRuleName - The name of the rule that will be used by this validator.onFail - The failure level.| Method Detail |
|---|
@Initialize public void initialize()
public void visitBefore(SAXElement element,
ExecutionContext executionContext)
throws SmooksException,
java.io.IOException
visitBefore in interface SAXVisitBeforeSmooksException
java.io.IOException
public void visitAfter(SAXElement element,
ExecutionContext executionContext)
throws SmooksException,
java.io.IOException
visitAfter in interface SAXVisitAfterSmooksException
java.io.IOException
public void visitAfter(org.w3c.dom.Element element,
ExecutionContext executionContext)
throws SmooksException
visitAfter in interface DOMVisitAfterSmooksExceptionpublic java.lang.String toString()
toString in class java.lang.Object@ConfigParam(name="name") public void setCompositRuleName(java.lang.String compositRuleName)
public java.lang.String getCompositRuleName()
@ConfigParam(defaultVal="ERROR") public void setOnFail(OnFail onFail)
public OnFail getOnFail()
public Validator setAppContext(ApplicationContext appContext)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||