Class ValueTag

  • All Implemented Interfaces:
    org.apache.commons.jelly.Tag

    public class ValueTag
    extends org.apache.commons.jelly.TagSupport

    A tag handler class for defining a value.

    This tag handler class can appear in the body of a tag implementing the ValueSupport interface. It evaluates its body, transforms it into a string, and passes the result to the ValueSupport tag.

    Typically tags producing a value (e.g. ParameterTag or SetPropertyTag) allow setting the value through attributes. XML attributes however have some constraints. For instance, it is not possible to specify a string value with newline characters. Because ValueTag obtains the value from its body these restrictions do not apply here. So this tag can be used to define more complex values. The values are then passed to the parent tag.

    Version:
    $Id: ValueTag.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Field Summary

      • Fields inherited from class org.apache.commons.jelly.TagSupport

        body, context, hasTrimmed, parent, shouldTrim
    • Constructor Summary

      Constructors 
      Constructor Description
      ValueTag()
      Creates a new instance of ValueTag.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doTag​(org.apache.commons.jelly.XMLOutput out)
      Executes this tag.
      • 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

      • ValueTag

        public ValueTag()
        Creates a new instance of ValueTag.
    • Method Detail

      • doTag

        public void doTag​(org.apache.commons.jelly.XMLOutput out)
                   throws org.apache.commons.jelly.JellyTagException
        Executes this tag. Obtains the parent tag (which must implement the ValueSupport interface) and passes the body of this tag to it as value.
        Parameters:
        out - the output object
        Throws:
        org.apache.commons.jelly.JellyTagException - if the tag is used incorrectly