Class ValidatorBaseTag<T extends Validator>
- 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<T>
-
- Type Parameters:
T
- the type of validator handled by this base class
- All Implemented Interfaces:
ConditionalTag
,PropertiesSupport
,PropertySupport
,org.apache.commons.jelly.DynaTag
,org.apache.commons.jelly.impl.BeanSource
,org.apache.commons.jelly.Tag
- Direct Known Subclasses:
ValidatorsTag
,ValidatorTag
public class ValidatorBaseTag<T extends Validator> extends TransformerBaseTag<T>
A base class for tag handler implementations that create validators for input components.
There are two kinds of validators supported by the form builder framework:
- plain (or primitive) validators
ChainValidator
s, which can contain multiple plain validators
- Version:
- $Id: ValidatorBaseTag.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 ValidatorBaseTag()
Creates a new instance ofValidatorTag
.ValidatorBaseTag(Class<?> defClass)
Creates a new instance ofValidatorTag
and sets the default class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ValidationPhase
getValidationPhase()
Returns the validation phase for the current validator.protected void
handleInputComponentTag(InputComponentTag tag, T bean)
Processes the specified input component tag.protected boolean
handleOtherParent(org.apache.commons.jelly.Tag parent, T bean)
Processes the parent tag if it is no input component tag.-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.TransformerBaseTag
getProperties, getTransformerContext, passResults, 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
-
-
-
-
Constructor Detail
-
ValidatorBaseTag
public ValidatorBaseTag()
Creates a new instance ofValidatorTag
.
-
ValidatorBaseTag
public ValidatorBaseTag(Class<?> defClass)
Creates a new instance ofValidatorTag
and sets the default class.- Parameters:
defClass
- the default class to be used
-
-
Method Detail
-
getValidationPhase
protected ValidationPhase getValidationPhase() throws org.apache.commons.jelly.JellyTagException
Returns the validation phase for the current validator.- Returns:
- the validation phase
- Throws:
org.apache.commons.jelly.JellyTagException
- if the phase is not set or invalid
-
handleInputComponentTag
protected void handleInputComponentTag(InputComponentTag tag, T bean) throws org.apache.commons.jelly.JellyTagException
Processes the specified input component tag. The validator will be passed to this tag.- Specified by:
handleInputComponentTag
in classTransformerBaseTag<T extends Validator>
- Parameters:
tag
- the input component tagbean
- the validator to pass- Throws:
org.apache.commons.jelly.JellyTagException
- if an error occurs
-
handleOtherParent
protected boolean handleOtherParent(org.apache.commons.jelly.Tag parent, T bean) throws org.apache.commons.jelly.JellyTagException
Processes the parent tag if it is no input component tag. This implementation checks whether the tag is a
. If this is the case, the child validator will be added to it.ValidatorsTag
- Overrides:
handleOtherParent
in classTransformerBaseTag<T extends Validator>
- Parameters:
parent
- the parent tagbean
- the validator bean- Returns:
- a flag whether the parent tag is supported
- Throws:
org.apache.commons.jelly.JellyTagException
- if an error occurs
-
-