org.apache.commons.jelly.tags.core
Class GetStaticTag

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by org.apache.commons.jelly.tags.core.GetStaticTag
All Implemented Interfaces:
Tag

public class GetStaticTag
extends TagSupport

A tag which can retrieve the value of a static field of a given class. The following attributes are required:

Example usage:
 <j:getStatic var="closeOperation" className="javax.swing.JFrame"
              field="EXIT_ON_CLOSE"/>
 

Version:
$Revision: 1807798 $

Field Summary
private  java.lang.String className
          The name of the class containing the static field.
private  java.lang.String field
          The name of the static field to retrieve.
private  java.lang.String var
          The variable to which to assign the resulting value.
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
GetStaticTag()
           
 
Method Summary
 void doTag(XMLOutput output)
          Evaluates this tag after all the tags properties have been initialized.
 void setClassName(java.lang.String className)
          Sets the fully qualified name of the class containing the static field.
 void setField(java.lang.String field)
          Sets the name of the field to retrieve.
 void setVar(java.lang.String var)
          Sets the name of the variable exported by this tag.
 
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

var

private java.lang.String var
The variable to which to assign the resulting value.


field

private java.lang.String field
The name of the static field to retrieve.


className

private java.lang.String className
The name of the class containing the static field.

Constructor Detail

GetStaticTag

public GetStaticTag()
Method Detail

setVar

public void setVar(java.lang.String var)
Sets the name of the variable exported by this tag.

Parameters:
var - The variable name.

setField

public void setField(java.lang.String field)
Sets the name of the field to retrieve.

Parameters:
method - The method name

setClassName

public void setClassName(java.lang.String className)
Sets the fully qualified name of the class containing the static field.

Parameters:
className - The name of the class.

doTag

public void doTag(XMLOutput output)
           throws JellyTagException
Description copied from interface: Tag
Evaluates this tag after all the tags properties have been initialized.

Throws:
JellyTagException