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
PropertySupportinterface (for instance a tag derived from theUseBeanBaseTagclass). 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
ValueSupportinterface. 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
SetPropertyTagclass. It also allows setting a property. However, the targets a different. WhileSetPropertyTagis used for setting properties of beans created by the dependency injection framework, this tag operates with tags implementing thePropertySupportinterface. 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 StringgetProperty()Returns the name of the property to be set by this tag.ObjectgetValue()Returns the value of the property.protected voidprocess()Processes this tag.voidsetProperty(String property)Set method of thepropertyattribute.voidsetValue(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 thepropertyattribute.- Parameters:
property- the attribute's value
-
setValue
public void setValue(Object v)
Set method of the value attribute.- Specified by:
setValuein 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, FormBuilderExceptionProcesses this tag. Tries to set the defined property at the parent tag.- Specified by:
processin classFormBaseTag- Throws:
org.apache.commons.jelly.JellyTagException- if the tag is incorrectly usedFormBuilderException- if an error occurs
-
-