|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jelly.TagSupport
org.apache.commons.jelly.DynaTagSupport
org.apache.commons.jelly.MapTagSupport
org.apache.commons.jelly.tags.core.UseBeanTag
A tag which instantiates an instance of the given class
and then sets the properties on the bean.
The class can be specified via a Class
instance or
a String which will be used to load the class using either the current
thread's context class loader or the class loader used to load this
Jelly library.
This tag can be used it as follows,
<j:useBean var="person" class="com.acme.Person" name="James" location="${loc}"/> <j:useBean var="order" class="${orderClass}" amount="12" price="123.456"/>
Field Summary | |
private java.lang.Object |
bean
the current bean instance |
private java.lang.Class |
defaultClass
the default class to use if no Class is specified |
Fields inherited from class org.apache.commons.jelly.MapTagSupport |
|
Fields inherited from class org.apache.commons.jelly.TagSupport |
body, context, hasTrimmed, parent, shouldTrim |
Constructor Summary | |
UseBeanTag()
|
|
UseBeanTag(java.lang.Class defaultClass)
|
Method Summary | |
protected java.lang.Class |
convertToClass(java.lang.Object classObject)
Attempts to convert the given object to a Class instance. |
void |
doTag(XMLOutput output)
Evaluates this tag after all the tags properties have been initialized. |
java.lang.Object |
getBean()
|
protected java.lang.Class |
getDefaultClass()
Allows derived classes to provide a default bean implementation class |
protected java.lang.Class |
loadClass(java.lang.String className)
Loads the given class using the default class loading mechanism which is to try use the current Thread's context class loader first otherise use the class loader which loaded this class. |
protected java.lang.Object |
newInstance(java.lang.Class theClass,
java.util.Map attributes,
XMLOutput output)
Creates a new instance of the given class, which by default will invoke the default constructor. |
protected void |
processBean(java.lang.String var,
java.lang.Object bean)
By default this will export the bean using the given variable if it is defined. |
protected void |
setBean(java.lang.Object bean)
Allow derived classes to programatically set the bean |
protected void |
setBeanProperties(java.lang.Object bean,
java.util.Map attributes)
Sets the properties on the bean. |
Methods inherited from class org.apache.commons.jelly.MapTagSupport |
createAttributes, getAttributes, setAttribute |
Methods inherited from class org.apache.commons.jelly.DynaTagSupport |
getAttributeType |
Methods inherited from class org.apache.commons.jelly.TagSupport |
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isTrim, setBody, setContext, setParent, setTrim, trimBody |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.jelly.Tag |
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent |
Field Detail |
private java.lang.Object bean
private java.lang.Class defaultClass
Constructor Detail |
public UseBeanTag()
public UseBeanTag(java.lang.Class defaultClass)
Method Detail |
public java.lang.Object getBean()
getBean
in interface BeanSource
public void doTag(XMLOutput output) throws JellyTagException
Tag
doTag
in interface Tag
JellyTagException
protected void setBean(java.lang.Object bean)
protected java.lang.Class convertToClass(java.lang.Object classObject) throws MissingAttributeException, java.lang.ClassNotFoundException
MissingAttributeException
java.lang.ClassNotFoundException
protected java.lang.Class loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected java.lang.Object newInstance(java.lang.Class theClass, java.util.Map attributes, XMLOutput output) throws JellyTagException
JellyTagException
protected void setBeanProperties(java.lang.Object bean, java.util.Map attributes) throws JellyTagException
JellyTagException
protected void processBean(java.lang.String var, java.lang.Object bean) throws JellyTagException
JellyTagException
protected java.lang.Class getDefaultClass()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |