org.apache.commons.jelly.tags.bean
Class BeanPropertyTag
java.lang.Object
org.apache.commons.jelly.TagSupport
org.apache.commons.jelly.DynaTagSupport
org.apache.commons.jelly.MapTagSupport
org.apache.commons.jelly.tags.core.UseBeanTag
org.apache.commons.jelly.tags.bean.BeanTag
org.apache.commons.jelly.tags.bean.BeanPropertyTag
- All Implemented Interfaces:
- org.apache.commons.jelly.impl.BeanSource, org.apache.commons.jelly.DynaTag, org.apache.commons.jelly.Tag
- public class BeanPropertyTag
- extends BeanTag
Creates a nested property via calling a beans createFoo() method then
either calling the setFoo(value) or addFoo(value) methods in a similar way
to how Ant tags construct themselves.
- Version:
- $Revision: 1.7 $
- Author:
- James Strachan, Christian Sell
Field Summary |
private java.lang.String |
createMethodName
the name of the create method |
private static java.lang.Class[] |
EMPTY_ARG_TYPES
empty argument types constant |
private static java.lang.Object[] |
EMPTY_ARGS
empty arguments constant |
Fields inherited from class org.apache.commons.jelly.tags.core.UseBeanTag |
|
Fields inherited from class org.apache.commons.jelly.MapTagSupport |
|
Fields inherited from class org.apache.commons.jelly.TagSupport |
body, context, hasTrimmed, parent, shouldTrim |
Method Summary |
protected java.lang.Class |
findAddMethodClass(java.lang.Class parentClass)
finds the parameter type of the first public method in the parent class whose name
matches the add{tag name} pattern, whose return type is void and which takes
one argument only. |
protected java.lang.reflect.Method |
findCreateMethod(java.lang.Class theClass)
Finds the Method to create a new property object |
protected java.lang.Object |
newInstance(java.lang.Class theClass,
java.util.Map attributes,
org.apache.commons.jelly.XMLOutput output)
Creates a new instance by calling a create method on the parent bean |
Methods inherited from class org.apache.commons.jelly.tags.core.UseBeanTag |
convertToClass, doTag, getBean, getDefaultClass, loadClass, setBean, setBeanProperties |
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 |
EMPTY_ARGS
private static final java.lang.Object[] EMPTY_ARGS
- empty arguments constant
EMPTY_ARG_TYPES
private static final java.lang.Class[] EMPTY_ARG_TYPES
- empty argument types constant
createMethodName
private java.lang.String createMethodName
- the name of the create method
BeanPropertyTag
public BeanPropertyTag(java.lang.String tagName)
newInstance
protected java.lang.Object newInstance(java.lang.Class theClass,
java.util.Map attributes,
org.apache.commons.jelly.XMLOutput output)
throws org.apache.commons.jelly.JellyTagException
- Creates a new instance by calling a create method on the parent bean
- Throws:
org.apache.commons.jelly.JellyTagException
findAddMethodClass
protected java.lang.Class findAddMethodClass(java.lang.Class parentClass)
- finds the parameter type of the first public method in the parent class whose name
matches the add{tag name} pattern, whose return type is void and which takes
one argument only.
- Parameters:
parentClass
-
- Returns:
- the class of the first and only parameter
findCreateMethod
protected java.lang.reflect.Method findCreateMethod(java.lang.Class theClass)
- Finds the Method to create a new property object