|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.iscreen.impl.BaseConfiguredValidator
org.iscreen.mvel.MvelConfiguredValidator
public class MvelConfiguredValidator
This ValidatorWrapper represents validators for MVEL-based XML configurations.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_FROM
|
static java.lang.String |
DEFAULT_TO
|
Fields inherited from class org.iscreen.impl.BaseConfiguredValidator |
---|
containingService, declared, doc, failFastFlag, id, ifExp, label, mappings, name, parsedDoc, ref, staticProperties, validator, validatorClass |
Constructor Summary | |
---|---|
MvelConfiguredValidator()
Default constructor. |
Method Summary | |
---|---|
void |
addMapping(java.lang.String from,
java.lang.String to)
Adds a mapping for mapping the object being validated to the beanToValidate object (that the Validator created). |
void |
addStaticProperty(java.lang.String property,
java.lang.Object obj)
Adds a "static" property to set on the underlying Validator. |
protected java.lang.String |
convertDoc(java.lang.Object obj,
java.lang.String unconvertedDoc)
Convert the documentation text using the embedded markers. |
protected void |
executeMappings(java.lang.Object from,
java.lang.Object to)
Maps the appropriate properties from one object to another. |
protected java.io.Serializable |
getCompiledIfExpression()
Obtains the pre-compiled version of the if expression. |
Validator |
getConfiguredValidator()
Creates the Validator and configures it. |
protected static MvelObjectMapping |
getDefaultMapping()
Create a default mapping so that if no mapping is defined in configuration, a default mapping can be used. |
protected java.util.Collection |
getFields()
Retrieves the Collection of fields (the 'getter' OGNL expressions) that are used in mapping properties from the JavaBean/Object being validated to the validation bean. |
void |
setIfExpression(java.lang.String exp)
Sets the 'if' expression that will determine whether this validator will be executed during validation. |
protected boolean |
shouldExecute(java.lang.Object obj)
Determines whether the inclusion/call to the validator should occur. |
Methods inherited from class org.iscreen.impl.BaseConfiguredValidator |
---|
getDoc, getFieldsTrace, getId, getIfExpression, getLabel, getMappings, getName, getRawDoc, getServiceId, getStaticProperties, getValidatorClass, isDeclared, isFailFast, setClassName, setDoc, setFailFast, setId, setLabel, setLabel, setName, setRef, setValidationService, signalDeclared, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_TO
public static final java.lang.String DEFAULT_FROM
Constructor Detail |
---|
public MvelConfiguredValidator()
Method Detail |
---|
protected void executeMappings(java.lang.Object from, java.lang.Object to)
executeMappings
in class BaseConfiguredValidator
from
- The object to map from.to
- The object to map to.public void addMapping(java.lang.String from, java.lang.String to)
addMapping
in class BaseConfiguredValidator
from
- The OGNL from expression (getter)to
- The OGNL to expression (setter)public void addStaticProperty(java.lang.String property, java.lang.Object obj)
addStaticProperty
in class BaseConfiguredValidator
property
- The MVEL expression to set a valueobj
- The value to set, once, on the Validator to configure it.protected static MvelObjectMapping getDefaultMapping()
public Validator getConfiguredValidator()
getConfiguredValidator
in class BaseConfiguredValidator
protected java.util.Collection getFields()
getFields
in class BaseConfiguredValidator
protected java.lang.String convertDoc(java.lang.Object obj, java.lang.String unconvertedDoc)
BaseConfiguredValidator
convertDoc
in class BaseConfiguredValidator
obj
- The context bean (root) for converting the doc.unconvertedDoc
- The raw documentation text.
protected boolean shouldExecute(java.lang.Object obj)
shouldExecute
in class BaseConfiguredValidator
obj
- The object being validated.
protected java.io.Serializable getCompiledIfExpression()
Serializable
representing the if expression.public void setIfExpression(java.lang.String exp)
setIfExpression
in class BaseConfiguredValidator
theExp
- The 'if' expression.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |