Class ConstructorTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.di.tags.InvocationTag
-
- net.sf.jguiraffe.gui.builder.di.tags.ConstructorInvocationTag
-
- net.sf.jguiraffe.gui.builder.di.tags.ConstructorTag
-
- All Implemented Interfaces:
org.apache.commons.jelly.Tag
public class ConstructorTag extends ConstructorInvocationTag
A specialized constructor invocation tag that is intended to be used inside a
<bean>
tag for defining theBeanProvider
for creating the managed bean.This tag handler class differs from its ancestor in the following ways:
- It must be a direct child of a
<bean>
tag. - The target class (on which the constructor is to be invoked) need not directly be defined using the tag's attributes. It can also be obtained from the enclosing bean tag.
- A
is created and initialized with the also createdConstructorBeanProvider
; this bean provider is then passed to the enclosing bean tag.ConstructorInvocation
All attributes available for the super class are also supported by this tag handler class.
- Version:
- $Id: ConstructorTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description ConstructorTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInvokable(Invokable inv)
Adds anInvokable
object to this tag.void
doTag(org.apache.commons.jelly.XMLOutput out)
The main method if this tag.BeanTag
getBeanTag()
Returns the enclosing bean tag.ClassDescription
getTargetClassDescription()
Returns the target class of the constructor to be invoked.protected void
process()
Executes this tag.protected void
setBeanTag(BeanTag tag)
Initializes the reference to the enclosingBeanTag
.-
Methods inherited from class net.sf.jguiraffe.gui.builder.di.tags.ConstructorInvocationTag
createInvocation
-
Methods inherited from class net.sf.jguiraffe.gui.builder.di.tags.InvocationTag
addParameter, getParameterDependencies, getParameterTypes, getResult, getSource, getTargetClassData, processInvokable, setResult, setTargetClass, setTargetClassLoader, setTargetClassName
-
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
-
addInvokable
public void addInvokable(Invokable inv) throws org.apache.commons.jelly.JellyTagException
Adds anInvokable
object to this tag. Because this tag registers itself asInvokableSupport
, this method will be automatically called by the super class. This makes it possible to obtain the reference to the created
.ConstructorInvocation
- Parameters:
inv
- the invocation object to add- Throws:
org.apache.commons.jelly.JellyTagException
- if the invocation object is not supported or another error occurs
-
getBeanTag
public BeanTag getBeanTag()
Returns the enclosing bean tag.- Returns:
- the enclosing bean tag
-
getTargetClassDescription
public ClassDescription getTargetClassDescription()
Returns the target class of the constructor to be invoked. This implementation tries to obtain this information from the bean tag if it is not explicitly set.- Overrides:
getTargetClassDescription
in classInvocationTag
- Returns:
- the target class
-
doTag
public void doTag(org.apache.commons.jelly.XMLOutput out) throws org.apache.commons.jelly.JellyTagException
The main method if this tag. Tries to obtain the enclosing
.BeanTag
- Specified by:
doTag
in interfaceorg.apache.commons.jelly.Tag
- Overrides:
doTag
in classInvocationTag
- Parameters:
out
- the output object- Throws:
org.apache.commons.jelly.JellyTagException
- if an error occurs
-
setBeanTag
protected void setBeanTag(BeanTag tag)
Initializes the reference to the enclosingBeanTag
. For fulfilling its task this tag has to interact with its parent bean tag.- Parameters:
tag
- the enclosing bean tag
-
process
protected void process() throws org.apache.commons.jelly.JellyTagException
Executes this tag.- Overrides:
process
in classInvocationTag
- Throws:
org.apache.commons.jelly.JellyTagException
- if an error occurs
-
-