Class PropertiesTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.di.tags.AbstractBeanTag
-
- net.sf.jguiraffe.gui.builder.di.tags.MapTag
-
- net.sf.jguiraffe.gui.builder.di.tags.PropertiesTag
-
- All Implemented Interfaces:
org.apache.commons.jelly.Tag
public class PropertiesTag extends MapTag
A specialized
MapTag
implementation for creating ajava.util.Properties
object.This tag behaves analogously to
MapTag
, but the bean created by this tag is of typejava.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 toString.class
, which should not be changed for properties.When adding values to the
Properties
object using theEntryTag
tag in the body of this tag, no type check will be performed. So it is possible to add values other than strings to theProperties
object (as is possible using the inheritedput()
method ofjava.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 Summary
Constructors Constructor Description PropertiesTag()
Creates a new instance ofPropertiesTag
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BeanProvider
createBeanProvider()
Creates theBeanProvider
managed by this tag.-
Methods inherited from class net.sf.jguiraffe.gui.builder.di.tags.MapTag
addEntry, getKeyClassData, getKeyClassDesc, getKeyDependencies, getName, getValueClassData, getValueClassDesc, getValueDependencies, isOrdered, processBeforeBody, setKeyClass, setKeyClassLoader, setKeyClassName, setName, setOrdered, setValueClass, setValueClassLoader, setValueClassName
-
Methods inherited from class net.sf.jguiraffe.gui.builder.di.tags.AbstractBeanTag
doTag, getBeanStoreTag, getStore, getTargetDependency, isAnonymous, process, setBeanStoreTag, setStore, store
-
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
-
createBeanProvider
protected BeanProvider createBeanProvider() throws org.apache.commons.jelly.JellyTagException
Creates theBeanProvider
managed by this tag. This implementation will create aPropertiesBeanProvider
object.- Overrides:
createBeanProvider
in classMapTag
- Returns:
- the bean provider
- Throws:
org.apache.commons.jelly.JellyTagException
- in case of an error
-
-