Class TransformerTag
- 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<Transformer>
-
- net.sf.jguiraffe.gui.builder.components.tags.TransformerTag
-
- All Implemented Interfaces:
ConditionalTag
,PropertiesSupport
,PropertySupport
,org.apache.commons.jelly.DynaTag
,org.apache.commons.jelly.impl.BeanSource
,org.apache.commons.jelly.Tag
public class TransformerTag extends TransformerBaseTag<Transformer>
A tag handler class for creating
Transformer
objects and passing them to input component tags.With this tag a transformer object can be defined, either by specifying the class name or by referencing an existing transformer. This can be done through the means supported by the
UseBeanBaseTag
. In addition to the properties supported by the base class the following attributes are supported:Attribute Description Optional type With this attribute it can be determined whether a read or a write transformer is to be defined: it can have the values read
orwrite
(case does not matter; if it is missing, read is assumed). Then the correct initialization method will be called on the enclosing input component tag.Yes componentType Here the type of the associated input component can be specified if necessary. The value of this attribute can be the fully qualified name of a class. If defined, the input component's setComponentType()
method will be invoked.Yes - Version:
- $Id: TransformerTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TransformerTag.Type
An enumeration for the possible types of a transformer.
-
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 TransformerTag()
Creates a new instance ofTransformerTag
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<?>
getComponentType()
Returns the type of the corresponding input component.protected TransformerTag.Type
getTransformerType()
Determines the type of the transformer based on thetype
attribute.protected void
handleInputComponentTag(InputComponentTag tag, Transformer bean)
Initializes the passed in input component tag with a transformer.-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.TransformerBaseTag
getProperties, getTransformerContext, handleOtherParent, 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
-
-
-
-
Method Detail
-
getComponentType
protected Class<?> getComponentType()
Returns the type of the corresponding input component. This is the target type of the transformer. This implementation returns the value of thecomponentType
attribute or null if it was not set.- Returns:
- the component type
-
getTransformerType
protected TransformerTag.Type getTransformerType() throws org.apache.commons.jelly.JellyTagException
Determines the type of the transformer based on thetype
attribute.- Returns:
- the transformer type
- Throws:
org.apache.commons.jelly.JellyTagException
- if the type is invalid
-
handleInputComponentTag
protected void handleInputComponentTag(InputComponentTag tag, Transformer bean) throws org.apache.commons.jelly.JellyTagException
Initializes the passed in input component tag with a transformer.- Specified by:
handleInputComponentTag
in classTransformerBaseTag<Transformer>
- Parameters:
tag
- the input component tagbean
- the transformer bean- Throws:
org.apache.commons.jelly.JellyTagException
- if an error occurs
-
-