Class PropertiesTag

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

    public class PropertiesTag
    extends MapTag

    A specialized MapTag implementation for creating a java.util.Properties object.

    This tag behaves analogously to MapTag, but the bean created by this tag is of type java.util.Properties. Following is an example of how this tag can be used:

     <constructor>
       <param>
         <properties>
           <entry key="db.user" value="scott"/>
           <entry key="db.pwd" value="tiger"/>
           <entry key="db.url" value="jdbc:thin:localhost:test"/>
         </properties>
       </param>
     </constructor>
     

    This tag does not specify any attributes. It inherits the attributes from its base class, MapTag, however in most cases their use makes hardly sense. The classes for keys and values are initialized to String.class, which should not be changed for properties.

    When adding values to the Properties object using the EntryTag tag in the body of this tag, no type check will be performed. So it is possible to add values other than strings to the Properties object (as is possible using the inherited put() method of java.util.Properties. It lies in the responsibility of a client application to ensure that only valid data is added to this tag.

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

      • PropertiesTag

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

      • createBeanProvider

        protected BeanProvider createBeanProvider()
                                           throws org.apache.commons.jelly.JellyTagException
        Creates the BeanProvider managed by this tag. This implementation will create a PropertiesBeanProvider object.
        Overrides:
        createBeanProvider in class MapTag
        Returns:
        the bean provider
        Throws:
        org.apache.commons.jelly.JellyTagException - in case of an error