| java.lang.Object javax.servlet.jsp.tagext.VariableInfo
VariableInfo | public class VariableInfo (Code) | | 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 | |
public static int | AT_BEGIN Constant for variables initialized at the beginning of a tag. | public static int | AT_END Constant for variables initialized at the end of a tag. | public static int | NESTED Constant for nested scope. |
Constructor Summary | |
public | VariableInfo(String varName, String className, boolean declare, int scope) Creates information for a variable. |
AT_BEGIN | public static int AT_BEGIN(Code) | | 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(Code) | | 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"));
|
NESTED | public static int NESTED(Code) | | 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)
|
VariableInfo | public VariableInfo(String varName, String className, boolean declare, int scope)(Code) | | Creates information for a variable. Generally called from a
TagExtraInfo class.
Parameters: varName - name of the variable Parameters: className - the java classname of the variable Parameters: declare - true if the variable should be declared Parameters: scope - the scope of the variable |
getClassName | public String getClassName()(Code) | | Returns the variable's Java class.
|
getDeclare | public boolean getDeclare()(Code) | | 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()(Code) | | Returns the variable's scope.
- AT_BEGIN - available as soon as the tag starts
- NESTED - only available in the tag body
- AT_END - only available after the tag ends.
|
getVarName | public String getVarName()(Code) | | Returns the variable name.
|
|
|