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.SetPropertyInvocationThis tag is initialized with the name of a property to be set and a
Dependencyto the property's value. It will then create aSetPropertyInvocationobject with this information and add it to theobject found in the current context. The following attributes are supported:InvokableSupportAttribute 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 refClassNameattribute 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 Invokableobject is to be executed. This attribute can only be used if aChainedInvocationis 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 voiddoTag(org.apache.commons.jelly.XMLOutput out)The main method of this tag.StringgetProperty()Returns the name of the property to be set by this tag.StringgetSource()Returns the name of the source variable.protected voidprocess()Executes this tag.voidsetProperty(String property)Set method of the property attribute.voidsetSource(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.JellyTagExceptionThe 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.JellyTagExceptionExecutes 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
-
-