|
||||||||||
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.DynaBeanTagSupport
org.apache.commons.jelly.impl.DynamicBeanTag
public class DynamicBeanTag
This tag is bound onto a Java Bean class. When the tag is invoked a bean will be created using the tags attributes. The bean may also have an invoke method called invoke(), run(), execute() or some such method which will be invoked after the bean has been configured.
Field Summary | |
---|---|
private java.util.Map |
attributes
the attribute definitions |
private java.lang.Object |
bean
the current bean instance |
private java.lang.Class |
beanClass
the bean class |
private static java.lang.Object[] |
emptyArgs
Empty arguments for Method.invoke() |
private static org.apache.commons.logging.Log |
log
The Log to which logging calls will be made. |
private java.lang.reflect.Method |
method
the method to invoke on the bean |
private java.util.Set |
setAttributesSet
the set of attribute names we've already set |
private java.lang.String |
var
the current variable name that the bean should be exported as |
private java.lang.String |
variableNameAttribute
the tag attribute name that is used to declare the name of the variable to export after running this tag |
Fields inherited from class org.apache.commons.jelly.TagSupport |
---|
body, context, hasTrimmed, parent, shouldTrim |
Constructor Summary | |
---|---|
DynamicBeanTag(java.lang.Class beanClass,
java.util.Map attributes,
java.lang.String variableNameAttribute,
java.lang.reflect.Method method)
|
Method Summary | |
---|---|
void |
beforeSetAttributes()
Callback to allow processing to occur before the attributes are about to be set |
void |
doTag(XMLOutput output)
Evaluates this tag after all the tags properties have been initialized. |
java.lang.Object |
getBean()
|
private void |
methodInvocationException(java.lang.Object bean,
java.lang.reflect.Method method,
java.lang.Exception e)
Report the state of the bean when method invocation fails so that the user can determine any problems that might be occuring while using dynamic jelly beans. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets an attribute value of this tag before the tag is invoked |
Methods inherited from class org.apache.commons.jelly.DynaBeanTagSupport |
---|
getAttributeType, getDynaBean, setContext, setDynaBean |
Methods inherited from class org.apache.commons.jelly.TagSupport |
---|
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setEscapeText, 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, setParent |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
private static final java.lang.Object[] emptyArgs
private java.lang.Class beanClass
private java.lang.Object bean
private java.lang.reflect.Method method
private java.lang.String variableNameAttribute
private java.lang.String var
private java.util.Set setAttributesSet
private java.util.Map attributes
Constructor Detail |
---|
public DynamicBeanTag(java.lang.Class beanClass, java.util.Map attributes, java.lang.String variableNameAttribute, java.lang.reflect.Method method)
beanClass
- Class of the bean that will receive the setter eventsattributes
- variableNameAttribute
- method
- method of the Bean to invoke after the attributes have been set. Can be null.Method Detail |
---|
public void beforeSetAttributes() throws JellyTagException
DynaBeanTagSupport
beforeSetAttributes
in class DynaBeanTagSupport
JellyTagException
public void setAttribute(java.lang.String name, java.lang.Object value) throws JellyTagException
DynaBeanTagSupport
setAttribute
in interface DynaTag
setAttribute
in class DynaBeanTagSupport
JellyTagException
public void doTag(XMLOutput output) throws JellyTagException
Tag
doTag
in interface Tag
JellyTagException
private void methodInvocationException(java.lang.Object bean, java.lang.reflect.Method method, java.lang.Exception e) throws JellyTagException
bean
- Bean on which method
method
- Method that was invokede
- Exception throw when method
was invoked
JellyTagException
public java.lang.Object getBean()
getBean
in interface BeanSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |