Class 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 or write (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
    • Constructor Detail

      • TransformerTag

        public TransformerTag()
        Creates a new instance of TransformerTag.
    • 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 the componentType 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 the type 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 class TransformerBaseTag<Transformer>
        Parameters:
        tag - the input component tag
        bean - the transformer bean
        Throws:
        org.apache.commons.jelly.JellyTagException - if an error occurs