org.apache.commons.jelly.tags.bean
Class BeanTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.DynaTagSupport
          extended byorg.apache.commons.jelly.MapTagSupport
              extended byorg.apache.commons.jelly.tags.core.UseBeanTag
                  extended byorg.apache.commons.jelly.tags.bean.BeanTag
All Implemented Interfaces:
org.apache.commons.jelly.impl.BeanSource, org.apache.commons.jelly.DynaTag, org.apache.commons.jelly.Tag
Direct Known Subclasses:
BeanPropertyTag

public class BeanTag
extends org.apache.commons.jelly.tags.core.UseBeanTag

Creates a bean for the given tag which is then either output as a variable or can be added to a parent tag.

Version:
$Revision: 155420 $
Author:
James Strachan, Christian Sell

Field Summary
protected  java.lang.String addMethodName
          the name of the adder method
protected static java.lang.Object[] EMPTY_ARGUMENTS
           
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
BeanTag()
           
BeanTag(java.lang.Class defaultClass, java.lang.String tagName)
           
BeanTag(java.lang.Class defaultClass, java.lang.String tagName, java.lang.reflect.Method invokeMethod)
           
 
Method Summary
protected  java.lang.reflect.Method findAddMethod(java.lang.Class beanClass, java.lang.Class valueClass)
          Finds the Method to add the new bean
protected  java.lang.Object getParentObject()
           
 java.lang.String getTagName()
           
protected  void processBean(java.lang.String var, java.lang.Object bean)
          Output the tag as a named variable.
 
Methods inherited from class org.apache.commons.jelly.tags.core.UseBeanTag
addIgnoreProperty, convertToClass, doTag, getBean, getDefaultClass, getIgnorePropertySet, isIgnoreUnknownProperties, loadClass, newInstance, setBean, setBeanProperties, setIgnoreUnknownProperties, validateBeanProperties
 
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, isEscapeText, isTrim, setBody, setContext, 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, setContext, setParent
 

Field Detail

EMPTY_ARGUMENTS

protected static final java.lang.Object[] EMPTY_ARGUMENTS

addMethodName

protected java.lang.String addMethodName
the name of the adder method

Constructor Detail

BeanTag

public BeanTag()

BeanTag

public BeanTag(java.lang.Class defaultClass,
               java.lang.String tagName)

BeanTag

public BeanTag(java.lang.Class defaultClass,
               java.lang.String tagName,
               java.lang.reflect.Method invokeMethod)
Method Detail

getTagName

public java.lang.String getTagName()
Returns:
the local name of the XML tag to which this tag is bound

processBean

protected void processBean(java.lang.String var,
                           java.lang.Object bean)
                    throws org.apache.commons.jelly.JellyTagException
Output the tag as a named variable. If the parent bean has an adder or setter method then invoke that to register this bean with its parent.

Throws:
org.apache.commons.jelly.JellyTagException

findAddMethod

protected java.lang.reflect.Method findAddMethod(java.lang.Class beanClass,
                                                 java.lang.Class valueClass)
Finds the Method to add the new bean


getParentObject

protected java.lang.Object getParentObject()
                                    throws org.apache.commons.jelly.JellyTagException
Returns:
the parent bean object
Throws:
org.apache.commons.jelly.JellyTagException


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.