javax.servlet.jsp.tagext
Class VariableInfo

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.VariableInfo

public class VariableInfo
extends java.lang.Object

TagExtraInfo classes generate VariableInfo objects to create runtime variables available to the tags.

For example, a NESTED variable could be used like:

 <mytag:loop name='i' min='0' max='10'>
   Iter: <%= i %>
 </mytag:loop>
 


Field Summary
static int AT_BEGIN
          Constant for variables initialized at the beginning of a tag.
static int AT_END
          Constant for variables initialized at the end of a tag.
static int NESTED
          Constant for nested scope.
 
Constructor Summary
VariableInfo(java.lang.String varName, java.lang.String className, boolean declare, int scope)
          Creates information for a variable.
 
Method Summary
 java.lang.String getClassName()
          Returns the variable's Java class.
 boolean getDeclare()
          True if the variable should be declared.
 int getScope()
          Returns the variable's scope.
 java.lang.String getVarName()
          Returns the variable name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NESTED

public static int NESTED
Constant for nested scope. A nested variable is only alive inside a tag's body:
 tag1.doInitBody();
 do {
   int foo = Integer.intValue(pageContext.getAttribute("foo"));
   ...
 } while (tag1.doAfterBody() == EVAL_BODY_TAG)
 

AT_BEGIN

public static int AT_BEGIN
Constant for variables initialized at the beginning of a tag. These variables are initialized after doStartTag()
 int _tmp = tag1.doStartTag();
 int foo = Integer.intValue(pageContext.getAttribute("foo"));
 if (_tmp == EVAL_BODY_INCLUDE) {
   ...
 }
 

AT_END

public static int AT_END
Constant for variables initialized at the end of a tag. These variables are initialized after doEndTag()
 int _tmp = tag1.doStartTag();
 if (_tmp == EVAL_BODY_INCLUDE) {
   ...
 }
 tag1.doEndTag();
 int foo = Integer.intValue(pageContext.getAttribute("foo"));
 
Constructor Detail

VariableInfo

public VariableInfo(java.lang.String varName,
                    java.lang.String className,
                    boolean declare,
                    int scope)
Creates information for a variable. Generally called from a TagExtraInfo class.
Parameters:
varName - name of the variable
className - the java classname of the variable
declare - true if the variable should be declared
scope - the scope of the variable
Method Detail

getVarName

public java.lang.String getVarName()
Returns the variable name.

getClassName

public java.lang.String getClassName()
Returns the variable's Java class.

getDeclare

public boolean getDeclare()
True if the variable should be declared. If false, the JSP engine assumes the variable is already declared and just assigns the value.

getScope

public int getScope()
Returns the variable's scope.