Tagpublic class ForTag extends BaseLoopTag
A ForTag represents a repetitively placed Block
of Cells, with each repetition corresponding to an increment of
an index.
BaseTag.BaseLoopTag.Stringintintint| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
ATTR_END |
Attribute for specifying the ending value (included in the range).
|
static java.lang.String |
ATTR_START |
Attribute for specifying the starting value.
|
static java.lang.String |
ATTR_STEP |
Attribute for specifying how much the value increments per iteration.
|
static java.lang.String |
ATTR_VAR |
Attribute for specifying the name of the looping variable.
|
ATTR_COLLAPSE, ATTR_COPY_RIGHT, ATTR_FIXED, ATTR_GROUP_DIR, ATTR_ON_LOOP_PROCESSED, ATTR_PAST_END_ACTION, ATTR_REPLACE_VALUE, ATTR_VAR_STATUS, GROUP_DIR_COLS, GROUP_DIR_NONE, GROUP_DIR_ROWS, PAST_END_ACTION_CLEAR, PAST_END_ACTION_REMOVE, PAST_END_ACTION_REPLACE_EXPRATTR_ON_PROCESSED, SPEC_SEP| Constructor | Description |
|---|---|
ForTag() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
afterBlockProcessed(TagContext context,
Block currBlock,
java.lang.Object item,
int index) |
Remove the index "item" from the
Map of beans. |
protected void |
beforeBlockProcessed(TagContext context,
Block currBlock,
java.lang.Object item,
int index) |
Place the index "item" into the
Map of beans. |
protected java.util.List<java.lang.String> |
getCollectionNames() |
Returns the names of the
Collections that are being used in
this ForTag. |
protected int |
getCollectionSize() |
Returns the number of iterations.
|
protected java.util.Iterator<java.lang.Integer> |
getLoopIterator() |
Returns an
Iterator that iterates over the desired values. |
protected ForLoopTagStatus |
getLoopTagStatus() |
Returns a
ForLoopTagStatus that will be exposed in the
beans map if the appropriate attribute is given. |
java.lang.String |
getName() |
Returns this
Tag's name. |
protected int |
getNumIterations() |
Returns the number of iterations.
|
java.util.List<java.lang.String> |
getOptionalAttributes() |
Returns the
List of optional attribute names. |
java.util.List<java.lang.String> |
getRequiredAttributes() |
Returns the
List of required attribute names. |
protected java.util.List<java.lang.String> |
getVarNames() |
Returns the variable names of the
Collections that are being used in
this ForTag. |
void |
validateAttributes() |
Validates the attributes for this
Tag. |
getPastEndAction, getReplacementExprValue, process, setCollapsed, setCopyRight, setFixed, setGroupDirection, setOnLoopProcessed, setPastEndAction, setReplaceExprValuecheckAttributes, clearBlock, deleteBlock, getAttributes, getContext, getLocation, getParentTag, getWorkbookContext, isBodiless, processTag, removeBlock, setAttributes, setBodiless, setContext, setParentTag, setWorkbookContextpublic static final java.lang.String ATTR_VAR
public static final java.lang.String ATTR_START
public static final java.lang.String ATTR_END
public static final java.lang.String ATTR_STEP
public java.lang.String getName()
Tag's name.Tag's name.public java.util.List<java.lang.String> getRequiredAttributes()
List of required attribute names.getRequiredAttributes in class BaseLoopTagList of required attribute names.public java.util.List<java.lang.String> getOptionalAttributes()
List of optional attribute names.getOptionalAttributes in class BaseLoopTagList of optional attribute names.public void validateAttributes()
throws TagParseException
Tag. The "start", "end",
and "step" attributes must evaluate to ints. If "step" is
not present, then it defaults to 1. The "step" must not be
zero. It is possible for no loops to be processed if "step" is positive
and "start" is greater than "end", or if "step" is negative and "start"
is less than "end".validateAttributes in class BaseLoopTagTagParseException - If the attribute values are illegal or
unacceptable.protected java.util.List<java.lang.String> getCollectionNames()
Collections that are being used in
this ForTag.getCollectionNames in class BaseLoopTagnull, no collections are being used.protected java.util.List<java.lang.String> getVarNames()
Collections that are being used in
this ForTag.getVarNames in class BaseLoopTagnull, no variables are being used for any collections.protected int getNumIterations()
ForTags.getNumIterations in class BaseLoopTagprotected int getCollectionSize()
getCollectionSize in class BaseLoopTagprotected ForLoopTagStatus getLoopTagStatus()
ForLoopTagStatus that will be exposed in the
beans map if the appropriate attribute is given.getLoopTagStatus in class BaseLoopTagForLoopTagStatus.protected java.util.Iterator<java.lang.Integer> getLoopIterator()
Iterator that iterates over the desired values.getLoopIterator in class BaseLoopTagIterator.protected void beforeBlockProcessed(TagContext context, Block currBlock, java.lang.Object item, int index)
Map of beans.beforeBlockProcessed in class BaseLoopTagcontext - The TagContext.currBlock - The Block that is about to processed.item - The Object that resulted from the iterator.index - The iteration index (0-based).protected void afterBlockProcessed(TagContext context, Block currBlock, java.lang.Object item, int index)
Map of beans.afterBlockProcessed in class BaseLoopTagcontext - The TagContext.index - The iteration index (0-based).item - The Object that resulted from the iterator.currBlock - The Block that was just processed.Copyright © 2012–2018 Jett Team. All rights reserved.