Class SetPropertyTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.di.tags.DependencyTag
-
- net.sf.jguiraffe.gui.builder.di.tags.SetPropertyTag
-
- All Implemented Interfaces:
ValueSupport
,org.apache.commons.jelly.Tag
public class SetPropertyTag extends DependencyTag
A tag handler class that creates a
object.SetPropertyInvocation
This tag is initialized with the name of a property to be set and a
Dependency
to the property's value. It will then create aSetPropertyInvocation
object with this information and add it to the
object found in the current context. The following attributes are supported:InvokableSupport
Attribute Description Optional property Defines the name of the property to set. This property must exist in the target class of the invocation. no refName Specifies a dependency to another bean. The bean with this name will be fetched and passed to the property setter method. yes refClass Specifies a dependency to another bean by its class. The bean with this class will be fetched and passed to the property setter method. yes refClassName Specifies a dependency to another bean by its class name. The bean with this class will be fetched and passed to the property setter method. yes refClassLoader With this attribute a symbolic name for the class loader to be used can be specified. It is evaluated only if the refClassName
attribute was set. In this case the class loader specified here will be used for resolving the class name.yes value If the property is to be set to a constant value, this attribute can be used. It allows to directly specify the value. yes valueClass If a constant value is to be used for the property value, it may be necessary to perform some type conversion. With this attribute the type of the property can be specified. The value will then be converted to this type. yes valueClassName Like valueClass
, but the name of the property's data type class is specified.yes valueClassLoader If the data type class of the value is specified by its name only, with this attribute the class loader can be determined for resolving the class. yes var If this invocation is part of a ChainedInvocation
, it is possible to refer to a local variable of this chain. This is done with this attribute.yes .source Defines the name of the local variable, on which this Invokable
object is to be executed. This attribute can only be used if aChainedInvocation
is in the current scope.yes From all the different ways of defining a dependency exactly one must be used.
- Version:
- $Id: SetPropertyTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description SetPropertyTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doTag(org.apache.commons.jelly.XMLOutput out)
The main method of this tag.String
getProperty()
Returns the name of the property to be set by this tag.String
getSource()
Returns the name of the source variable.protected void
process()
Executes this tag.void
setProperty(String property)
Set method of the property attribute.void
setSource(String source)
Set method of the source attribute.-
Methods inherited from class net.sf.jguiraffe.gui.builder.di.tags.DependencyTag
createDependency, createValueDependency, getDependency, getRefClassData, getRefName, getValueData, getVar, hasDependency, processDependencyDefinitions, setDependency, setRefClass, setRefClassLoader, setRefClassName, setRefName, setValue, setValueClass, setValueClassLoader, setValueClassName, setVar
-
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 the property attribute.- Parameters:
property
- the attribute's value
-
getSource
public String getSource()
Returns the name of the source variable. This may be used if this tag is used inside an invocation chain.- Returns:
- the name of the source variable
-
setSource
public void setSource(String source)
Set method of the source attribute.- Parameters:
source
- the attribute's value
-
doTag
public void doTag(org.apache.commons.jelly.XMLOutput out) throws org.apache.commons.jelly.JellyTagException
The main method of this tag. Invokes the body and delegates toprocess()
.- Parameters:
out
- the output object- Throws:
org.apache.commons.jelly.JellyTagException
- in case of an error
-
process
protected void process() throws org.apache.commons.jelly.JellyTagException
Executes this tag. This method is invoked bydoTag()
and does the real work.- Throws:
org.apache.commons.jelly.JellyTagException
- if an error occurs or the tag is incorrectly used
-
-