| java.lang.Object org.iscreen.impl.BaseConfiguredValidator
All known Subclasses: org.iscreen.mvel.MvelConfiguredValidator, org.iscreen.ognl.OgnlConfiguredValidator,
BaseConfiguredValidator | abstract public class BaseConfiguredValidator implements ValidatorWrapper(Code) | | This base class represents a wrapper around a validator that handles the actual call
to the validator. This class is subclassed by OGNL or MVEL to handle the actual
interpretation of how to handle mappings, etc.
author: Shellman, Dan |
Method Summary | |
abstract public void | addMapping(String from, String to) Adds a mapping for mapping the object being validated to the
beanToValidate object (that the Validator created). | abstract public void | addStaticProperty(String property, Object obj) Adds a "static" property to set on the underlying Validator. | abstract protected String | convertDoc(Object contextBean, String unconvertedDoc) Convert the documentation text using the embedded markers.
Parameters: contextBean - The context bean (root) for converting the doc. Parameters: unconvertedDoc - The raw documentation text. | abstract protected void | executeMappings(Object from, Object to) Maps the appropriate properties from one object to another. | abstract public Validator | getConfiguredValidator() Creates the Validator and configures it. | public DocumentationIterator | getDoc() Retrieves the documentation (parsed and updated) for this validator. | abstract protected 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. | public String | getId() Gets the id of this wrapper. | public String | getLabel(Locale locale) Gets the value of the label for this Validator wrapper. | public Set | getMappings() Gets the Set of mappings for this Validator and any Validator
this Validator references. | public String | getName() | protected String | getRawDoc() Retrieves the raw documentation for this. | protected String | getServiceId() | public Set | getStaticProperties() Retrieves the Set of static properties (which are OgnlPropertyMapping
objects). | public Class | getValidatorClass() Returns the Class of the Validator this class is wrapping (this may
retrieve the Class from another wrapper this wrapper references). | public boolean | isFailFast() Whether this wrapper should report to the validation service
not to continue validating if this wrapper finds a failure. | public void | setClassName(String className) Sets the class name of the Validator this class is wrapping. | public void | setDoc(String documentation) Sets the documentation for this configured validator. | public void | setFailFast(boolean flag) Sets whether this wrapper should report to the validation service
not to continue validating if this wrapper finds a failure. | public void | setId(String theId) Sets the id of this wrapper. | public void | setLabel(Resource resource, String key) Sets the Label for this Validator wrapper. | public void | setLabel(String labelValue) Sets the label for this Validator wrapper. | public void | setName(String theName) Sets the name of the validator. | public void | setRef(BaseConfiguredValidator configuredValidatorRef) Sets a wrapper this wrapper may reference. | public void | setValidationService(ValidationService service) Sets the ValidationService (ValidationSet) that contains this
Validator wrapper. | public boolean | validate(InternalValidatorContext context, ContextBean contextBean, Object obj) |
failFastFlag | protected boolean failFastFlag(Code) | | |
staticProperties | protected Set staticProperties(Code) | | |
BaseConfiguredValidator | public BaseConfiguredValidator()(Code) | | Default constructor.
|
addMapping | abstract public void addMapping(String from, String to)(Code) | | Adds a mapping for mapping the object being validated to the
beanToValidate object (that the Validator created).
Parameters: from - The OGNL from expression (getter) Parameters: to - The OGNL to expression (setter) |
addStaticProperty | abstract public void addStaticProperty(String property, Object obj)(Code) | | Adds a "static" property to set on the underlying Validator. A
"static" property is really an OGNL expression that will set
some value on the Validator once (such as a constraint, service,
or failure message).
For failures, the object type should be an OgnlMessage. For
a constraint or service, any object type is fine (as long as it
maps to the underlying Validator property).
Parameters: property - The OGNL expression to set a value Parameters: obj - The value to set, once, on the Validator to configure it. |
convertDoc | abstract protected String convertDoc(Object contextBean, String unconvertedDoc)(Code) | | Convert the documentation text using the embedded markers.
Parameters: contextBean - The context bean (root) for converting the doc. Parameters: unconvertedDoc - The raw documentation text. Returns the converted documentation text. |
executeMappings | abstract protected void executeMappings(Object from, Object to)(Code) | | Maps the appropriate properties from one object to another.
Parameters: from - The object to map from. Parameters: to - The object to map to. |
getConfiguredValidator | abstract public Validator getConfiguredValidator()(Code) | | Creates the Validator and configures it. Multiple calls will NOT
construct a new Validator each call, but will return the same
instance created the first time.
Returns a created and configured Validator. |
getDoc | public DocumentationIterator getDoc()(Code) | | Retrieves the documentation (parsed and updated) for this validator.
Returns the documentation for this validator. |
getFields | abstract protected Collection getFields()(Code) | | 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.
Returns the Collection of fields. |
getId | public String getId()(Code) | | Gets the id of this wrapper. If one hasn't been set, the
validator this references will be returned. However, if there
is no id, then an empty string is returned.
Returns the id of this wrapper. |
getLabel | public String getLabel(Locale locale)(Code) | | Gets the value of the label for this Validator wrapper.
Based upon the locale, the value of the label *may*
be different (if a static one was set, then it
won't be different from what was set).
Returns the value of the label, based onthe current locale. |
getMappings | public Set getMappings()(Code) | | Gets the Set of mappings for this Validator and any Validator
this Validator references.
Returns the Set of mappings for this Validator. |
getRawDoc | protected String getRawDoc()(Code) | | Retrieves the raw documentation for this. The referenced validator is
also checked, if necessary.
Returns the raw documentation. |
getStaticProperties | public Set getStaticProperties()(Code) | | Retrieves the Set of static properties (which are OgnlPropertyMapping
objects). This method is used to retrieve not only this wrapper's
Set of static properties (see the addStaticProperty() method for
what a static property is), but to also get the properties from
any wrapper that this wrapper references, returning a combined
Set (it's a Set to ensure that there are no duplicates based upon
the property, or OGNL expression, of the OgnlPropertyMapping objects).
Returns the Set of "static" properties for this wrapper andany referenced wrapper (no duplicates, though). |
getValidatorClass | public Class getValidatorClass()(Code) | | Returns the Class of the Validator this class is wrapping (this may
retrieve the Class from another wrapper this wrapper references).
Returns the Validator this class is wrapping. |
isFailFast | public boolean isFailFast()(Code) | | Whether this wrapper should report to the validation service
not to continue validating if this wrapper finds a failure.
Returns if a failure will result in no further validations. |
setClassName | public void setClassName(String className)(Code) | | Sets the class name of the Validator this class is wrapping.
Parameters: className - The class name of the Validator |
setDoc | public void setDoc(String documentation)(Code) | | Sets the documentation for this configured validator.
Parameters: documentation - The documentation for this validator. |
setFailFast | public void setFailFast(boolean flag)(Code) | | Sets whether this wrapper should report to the validation service
not to continue validating if this wrapper finds a failure.
Parameters: flag - If true, a failure will result in no further validations. |
setId | public void setId(String theId)(Code) | | Sets the id of this wrapper. A Validator may or may not
have an id. If this wrapper represents a configured validator
that's configured as part of a validation set, then it won't
have an id.
Parameters: theId - The id of this wrapper. |
setLabel | public void setLabel(Resource resource, String key)(Code) | | Sets the Label for this Validator wrapper. This label is
based upon a Resource and a key into that resource.
Parameters: resource - The Resource the label's value is in Parameters: key - The key to the label's value |
setLabel | public void setLabel(String labelValue)(Code) | | Sets the label for this Validator wrapper. This label
is a static string.
Parameters: labelValue - The value of the label. |
setName | public void setName(String theName)(Code) | | Sets the name of the validator. This name is a non-unique identifier
used to report back on validation failures the validator that
was involved in the failure.
Parameters: theName - The name of the validator. |
setRef | public void setRef(BaseConfiguredValidator configuredValidatorRef)(Code) | | Sets a wrapper this wrapper may reference. Consider this reference
as a delegated parent.
Parameters: configuredValidatorRef - The delegated parent of this wrapper. |
setValidationService | public void setValidationService(ValidationService service)(Code) | | Sets the ValidationService (ValidationSet) that contains this
Validator wrapper.
Parameters: service - The ValidationService that contains this wrapper. |
|
|