Class PropertyTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
-
- net.sf.jguiraffe.gui.builder.components.tags.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 theUseBeanBaseTag
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. WhileSetPropertyTag
is used for setting properties of beans created by the dependency injection framework, this tag operates with tags implementing thePropertySupport
interface. It is mainly used together with tags derived fromUseBeanBaseTag
.- Version:
- $Id: PropertyTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description PropertyTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getProperty()
Returns the name of the property to be set by this tag.Object
getValue()
Returns the value of the property.protected void
process()
Processes this tag.void
setProperty(String property)
Set method of theproperty
attribute.void
setValue(Object v)
Set method of the value attribute.-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
canProcess, canProcess, convertToClass, convertToNumberWithUnit, convertToNumberWithUnit, doTag, findContainer, getBuilderData, getBuilderData, getIfName, getResourceText, getResourceText, getUnlessName, processBeforeBody, setIfName, setUnlessName
-
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
-
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 theproperty
attribute.- Parameters:
property
- the attribute's value
-
setValue
public void setValue(Object v)
Set method of the value attribute.- Specified by:
setValue
in interfaceValueSupport
- 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 classFormBaseTag
- Throws:
org.apache.commons.jelly.JellyTagException
- if the tag is incorrectly usedFormBuilderException
- if an error occurs
-
-