net.sf.jameleon
Class JameleonTagSupport

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by net.sf.jameleon.LocationAwareTagSupport
          extended by net.sf.jameleon.JameleonTagSupport
All Implemented Interfaces:
Attributable, DynaTag, LocationAware, Tag
Direct Known Subclasses:
AbstractDataDrivableTag, FunctionTag, SessionTag, TestScriptTag, TestSuiteTag

public abstract class JameleonTagSupport
extends LocationAwareTagSupport
implements DynaTag, Attributable

JameleonTagSupport is an implementation of DynaTag. This tag throws the variable name as the XML attribute into the context. It then attempts to call to corresponding set method. There is currently no checking on whether the set method was called or not. If it's there, then it gets called. Calling the set method is mostly for backward compatability. However, it can be used for set methods that need to do more than put the variable in the context.

Currently, this class is only used by FunctionTag. It was intended to be the base class for all Jameleon tags.


Field Summary
protected  Map attributes
          A map of class attributes and their corresponding types.
protected  AttributeBroker broker
          Used to transfer context variables to instance variables.
protected  List contextVars
          A list of variable names that were stored in the context.
protected  FunctionalPoint fp
          Represents this tag's attributes
protected  List unsupportedAttributes
           
 
Fields inherited from class net.sf.jameleon.LocationAwareTagSupport
columnNumber, elementTagName, lineNumber, scriptFileName
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
JameleonTagSupport()
           
 
Method Summary
protected  void cleanVariablesInContext()
           
protected  Map createAttributes()
          Simply returns the context for this tag
 void describeAttributes(AttributeBroker broker)
          Registers all instance variables and key values in a JellyContext.
 AttributeBroker getAttributeBroker()
           
protected  Map getAttributes()
          Helper method which allows derived tags to access the attributes associated with this tag
 Class getAttributeType(String name)
           
protected  Map getClassAttributes()
          Gets the attributes or fields of the tag
 FunctionalPoint getFunctionalPoint()
           
 List getUnsupportedAttributes()
           
 FunctionalPoint loadFunctionalPoint()
           
protected  void resetFunctionalPoint()
           
 void setAttribute(String name, Object value)
          Sets an attribute value of this tag before the tag is invoked
protected  void setVariableInContext(String name, Object value)
           
protected  void testForUnsupportedAttributesCaught()
           
 
Methods inherited from class net.sf.jameleon.LocationAwareTagSupport
getColumnNumber, getElementName, getFileName, getLineNumber, setColumnNumber, setElementName, setFileName, setLineNumber
 
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
doTag, getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Field Detail

attributes

protected Map attributes
A map of class attributes and their corresponding types.


contextVars

protected List contextVars
A list of variable names that were stored in the context.


broker

protected AttributeBroker broker
Used to transfer context variables to instance variables.


fp

protected FunctionalPoint fp
Represents this tag's attributes


unsupportedAttributes

protected List unsupportedAttributes
Constructor Detail

JameleonTagSupport

public JameleonTagSupport()
Method Detail

loadFunctionalPoint

public FunctionalPoint loadFunctionalPoint()

getUnsupportedAttributes

public List getUnsupportedAttributes()

testForUnsupportedAttributesCaught

protected void testForUnsupportedAttributesCaught()

setAttribute

public void setAttribute(String name,
                         Object value)
Sets an attribute value of this tag before the tag is invoked

Specified by:
setAttribute in interface DynaTag

setVariableInContext

protected void setVariableInContext(String name,
                                    Object value)

cleanVariablesInContext

protected void cleanVariablesInContext()

getAttributes

protected Map getAttributes()
Helper method which allows derived tags to access the attributes associated with this tag

Returns:
the context of the tag.

getAttributeBroker

public AttributeBroker getAttributeBroker()

createAttributes

protected Map createAttributes()
Simply returns the context for this tag


getClassAttributes

protected Map getClassAttributes()
Gets the attributes or fields of the tag


getAttributeType

public Class getAttributeType(String name)
                       throws JellyTagException
Specified by:
getAttributeType in interface DynaTag
Returns:
the type of the given attribute. If we can't figure out the type of variable, simply return Object.class Required for dyna tag support.
Throws:
JellyTagException

resetFunctionalPoint

protected void resetFunctionalPoint()

getFunctionalPoint

public FunctionalPoint getFunctionalPoint()

describeAttributes

public void describeAttributes(AttributeBroker broker)
Description copied from interface: Attributable
Registers all instance variables and key values in a JellyContext. Called by the AttributeBroker.

Specified by:
describeAttributes in interface Attributable
Parameters:
broker - - The AttributeBroker which will transfer the values to instance variables.


Copyright © 2003-2008 Christian Hargraves. All Rights Reserved.