Class ValidatorsTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- org.apache.commons.jelly.DynaTagSupport
-
- org.apache.commons.jelly.MapTagSupport
-
- org.apache.commons.jelly.tags.core.UseBeanTag
-
- net.sf.jguiraffe.gui.builder.components.tags.UseBeanBaseTag
-
- net.sf.jguiraffe.gui.builder.components.tags.TransformerBaseTag<T>
-
- net.sf.jguiraffe.gui.builder.components.tags.ValidatorBaseTag<ChainValidator>
-
- net.sf.jguiraffe.gui.builder.components.tags.ValidatorsTag
-
- All Implemented Interfaces:
ConditionalTag
,PropertiesSupport
,PropertySupport
,org.apache.commons.jelly.DynaTag
,org.apache.commons.jelly.impl.BeanSource
,org.apache.commons.jelly.Tag
public class ValidatorsTag extends ValidatorBaseTag<ChainValidator>
A tag handler class for combining multiple validators to be assigned to an input component.
In some cases a single validator is not sufficient for testing the validity of an input field; multiple validators are needed (e.g. a required validator plus a data type specific validator). With this tag handler class a
can be created, which can combine an arbitrary number of child validators.ChainValidator
This tag can be put in the body of a tag defining an input component. In the tag's body an arbitrary number of nested
<validator>
tags (as implemented by
) can be placed. Each validator defined by these child tags will be added to the resultingValidatorTag
.ChainValidator
The following table lists the attributes supported by this tag:
Attribute Description Optional shortEvaluation Here a boolean value can be specified controlling the shortEvaluation
flag of the resultingChainValidator
. Have a look at
for more details. The default value is true.ChainValidator
Yes - Version:
- $Id: ValidatorsTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Field Summary
-
Fields inherited from class net.sf.jguiraffe.gui.builder.components.tags.UseBeanBaseTag
ATTR_BEAN_CLASS, ATTR_BEAN_NAME, ATTR_CLASS, ATTR_IF_NAME, ATTR_REF, ATTR_UNLESS_NAME, ATTR_VAR
-
-
Constructor Summary
Constructors Constructor Description ValidatorsTag()
Creates a new instance ofValidatorsTag
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChildValidator(Validator child, Map<String,Object> props)
Adds a new child validator.protected boolean
passResults(Object bean)
Passes the resulting bean to its target.-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.ValidatorBaseTag
getValidationPhase, handleInputComponentTag, handleOtherParent
-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.TransformerBaseTag
getProperties, getTransformerContext, setProperties
-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.UseBeanBaseTag
addIgnoreProperties, doTag, fetchBean, getAdditionalProperties, getAttributeStr, getBaseClass, getIfName, getUnlessName, isOptional, processBean, setBaseClass, setProperty, useExistingBean
-
Methods inherited from class org.apache.commons.jelly.tags.core.UseBeanTag
addIgnoreProperty, convertToClass, getBean, getDefaultClass, getIgnorePropertySet, isIgnoreUnknownProperties, loadClass, newInstance, setBean, setBeanProperties, setIgnoreUnknownProperties, validateBeanProperties
-
Methods inherited from class org.apache.commons.jelly.MapTagSupport
createAttributes, getAttributes, setAttribute
-
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
-
-
-
-
Method Detail
-
addChildValidator
public void addChildValidator(Validator child, Map<String,Object> props)
Adds a new child validator. This method is intended to be called by tags in the body that define child validators.- Parameters:
child
- the validator to addprops
- a map with optional properties for this child validator
-
passResults
protected boolean passResults(Object bean) throws org.apache.commons.jelly.JellyTagException
Passes the resulting bean to its target. This implementation initializes the resultingChainValidator
with the child validators added by child tags.- Overrides:
passResults
in classTransformerBaseTag<ChainValidator>
- Parameters:
bean
- the (validator) bean to initialize- Returns:
- a flag whether the bean could be passed to the target
- Throws:
org.apache.commons.jelly.JellyTagException
- if an error occurs
-
-