Class InvocationTargetTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.di.tags.DependencyTag
-
- net.sf.jguiraffe.gui.builder.di.tags.InvocationTargetTag
-
- All Implemented Interfaces:
ValueSupport
,org.apache.commons.jelly.Tag
public class InvocationTargetTag extends DependencyTag
A specialized tag handler implementation for defining the target object of a method invocation.
When a
MethodInvocationTag
is used in the initializer script of a bean declaration the method is typically invoked on the managed object which is the result of the bean declaration. UsingInvocationTargetTag
it is possible to define a different target, e.g. another bean defined in the current bean context. A use case would be a factory bean which is called to create objects of a specific type. The following example fragment shows how the tag can be used in an initializer script of a bean declaration:<di:bean name="initializer" singleton="false"> <di:methodInvocation method="create" result="obj"> <di:param parameterClass="java.lang.String" refName="strConst"/> <di:invocationTarget refName="factory"/> </di:methodInvocation> ... </di:bean>
The tag defines no attributes in addition to the ones inherited from its base class. So basically the various options for defining the dependency are available. Refer to the documentation of
DependencyTag
orParameterTag
. The tag must occur in the body of aMethodInvocationTag
.- Since:
- 1.1
- Version:
- $Id: InvocationTargetTag.java 207 2012-02-09 07:30:13Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description InvocationTargetTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doTag(org.apache.commons.jelly.XMLOutput output)
This implementation determines the parent tag which must be of typeMethodInvocationTag
.-
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
-
doTag
public void doTag(org.apache.commons.jelly.XMLOutput output) throws org.apache.commons.jelly.JellyTagException
This implementation determines the parent tag which must be of typeMethodInvocationTag
. This tag is passed the dependency defined here.- Throws:
org.apache.commons.jelly.JellyTagException
-
-