Tag
public 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
.String
int
int
int
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_EXPR
ATTR_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, setReplaceExprValue
checkAttributes, clearBlock, deleteBlock, getAttributes, getContext, getLocation, getParentTag, getWorkbookContext, isBodiless, processTag, removeBlock, setAttributes, setBodiless, setContext, setParentTag, setWorkbookContext
public 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 BaseLoopTag
List
of required attribute names.public java.util.List<java.lang.String> getOptionalAttributes()
List
of optional attribute names.getOptionalAttributes
in class BaseLoopTag
List
of optional attribute names.public void validateAttributes() throws TagParseException
Tag
. The "start", "end",
and "step" attributes must evaluate to int
s. 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 BaseLoopTag
TagParseException
- 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 BaseLoopTag
null
, no collections are being used.protected java.util.List<java.lang.String> getVarNames()
Collections
that are being used in
this ForTag
.getVarNames
in class BaseLoopTag
null
, no variables are being used for any collections.protected int getNumIterations()
ForTags
.getNumIterations
in class BaseLoopTag
protected int getCollectionSize()
getCollectionSize
in class BaseLoopTag
protected ForLoopTagStatus getLoopTagStatus()
ForLoopTagStatus
that will be exposed in the
beans map if the appropriate attribute is given.getLoopTagStatus
in class BaseLoopTag
ForLoopTagStatus
.protected java.util.Iterator<java.lang.Integer> getLoopIterator()
Iterator
that iterates over the desired values.getLoopIterator
in class BaseLoopTag
Iterator
.protected void beforeBlockProcessed(TagContext context, Block currBlock, java.lang.Object item, int index)
Map
of beans.beforeBlockProcessed
in class BaseLoopTag
context
- 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 BaseLoopTag
context
- 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.