net.sf.jameleon
Class ParamTag

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by net.sf.jameleon.ParamTag
All Implemented Interfaces:
Tag
Direct Known Subclasses:
SqlParamTag

public class ParamTag
extends TagSupport

Used to give a function tag a parameter or a list of parameters. For example:

      <param>
          <param-name>someName</param-name>
          <param-value>foo</param-value>
          <param-type>text</param-type>
      </param>
 
This tag adds itself to a list of param tags to the parent FunctionTag. It's up to the FunctionTag to use the parameters. They can be accessed via the FunctionTag.getParams() method.

Tag Name: <param>

Field Summary
protected  String fromVariable
           
protected  String name
          The name of param.
protected  String paramType
          The input type of the param (text, checkbox, listbox...)
protected  ArrayList values
          The value of the param.
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
ParamTag()
           
 
Method Summary
 void addParamValue(String value)
          Adds a value to the list of values supplied for this parameter.
 void doTag(XMLOutput out)
           
 String getFromVariable()
           
 String getName()
           
 String getParamName()
           
 String getParamType()
           
 ArrayList getParamValues()
           
 String getValue()
           
 void setFromVariable(String fromVar)
           
 void setParamName(String paramName)
           
 void setParamType(String paramType)
           
 void setParamValue(String value)
           
protected  void validate()
          Used to validate everything is set up correctly.
 
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
 

Field Detail

values

protected ArrayList values
The value of the param.


name

protected String name
The name of param.


paramType

protected String paramType
The input type of the param (text, checkbox, listbox...)


fromVariable

protected String fromVariable
Constructor Detail

ParamTag

public ParamTag()
Method Detail

doTag

public void doTag(XMLOutput out)
           throws MissingAttributeException,
                  JellyTagException
Throws:
MissingAttributeException
JellyTagException

validate

protected void validate()
                 throws MissingAttributeException,
                        JellyTagException
Used to validate everything is set up correctly.

Throws:
MissingAttributeException - - When a required attribute isn't set.
JellyTagException - - When this tag is used out of context.

getParamType

public String getParamType()
Returns:
The param type

getValue

public String getValue()
Returns:
The first param value from the list of values

getParamValues

public ArrayList getParamValues()
Returns:
The param values

addParamValue

public void addParamValue(String value)
Adds a value to the list of values supplied for this parameter.

Parameters:
value - The param value

getName

public String getName()
Returns:
The param name

getParamName

public String getParamName()
Returns:
The param name

setParamName

public void setParamName(String paramName)

setParamValue

public void setParamValue(String value)

setParamType

public void setParamType(String paramType)

getFromVariable

public String getFromVariable()

setFromVariable

public void setFromVariable(String fromVar)


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