Class PropertyTag

  • All Implemented Interfaces:
    ConditionalTag, ValueSupport, org.apache.commons.jelly.Tag

    public class PropertyTag
    extends FormBaseTag
    implements ValueSupport

    A tag for setting a property.

    This tag can be placed in the body of a tag implementing the PropertySupport interface (for instance a tag derived from the UseBeanBaseTag class). From its attributes it will obtain the key and the value of a property and set this property on its parent tag. The following attributes are supported:

    Attribute Description Optional
    property Defines the name of the property. No
    value Defines the value of the property. This can be an arbitrary object, and even be null. It will be passed as is to the parent tag. Yes

    This tag handler class implements the ValueSupport interface. Therefore tags in this tag's body can define its value which is then passed to the parent tag.

    Note: From its functionality this tag is similar to the SetPropertyTag class. It also allows setting a property. However, the targets a different. While SetPropertyTag is used for setting properties of beans created by the dependency injection framework, this tag operates with tags implementing the PropertySupport interface. It is mainly used together with tags derived from UseBeanBaseTag.

    Version:
    $Id: PropertyTag.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • PropertyTag

        public PropertyTag()
    • Method Detail

      • getProperty

        public String getProperty()
        Returns the name of the property to be set by this tag.
        Returns:
        the property name
      • setProperty

        public void setProperty​(String property)
        Set method of the property attribute.
        Parameters:
        property - the attribute's value
      • setValue

        public void setValue​(Object v)
        Set method of the value attribute.
        Specified by:
        setValue in interface ValueSupport
        Parameters:
        v - the attribute's value
      • getValue

        public Object getValue()
        Returns the value of the property.
        Returns:
        the value of the property
      • process

        protected void process()
                        throws org.apache.commons.jelly.JellyTagException,
                               FormBuilderException
        Processes this tag. Tries to set the defined property at the parent tag.
        Specified by:
        process in class FormBaseTag
        Throws:
        org.apache.commons.jelly.JellyTagException - if the tag is incorrectly used
        FormBuilderException - if an error occurs