|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jett.tag.BaseTag
net.sf.jett.tag.BaseLoopTag
net.sf.jett.tag.ForEachTag
public class ForEachTag
A ForEachTag represents a repetitively placed
Block of Cells, with each repetition corresponding
to an element of a Collection. The var attribute
represents the variable name by which a collection item is known. The
optional indexVar attribute is the name of the variable that
holds the iterator index. The optional where attribute filters
the collection by the given condition. The optional limit
attribute specifies a limit to the number of iterations to be run from the
collection. If the limit is greater than the number of items in the
collection, then blank blocks will result, with the exact result dependent
on "past end action" rules.
BaseTag.BaseLoopTag.CollectionStringStringbooleanintList<String>List<String>
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_GROUP_BY
Attribute for specifying the property or properties by which to group the Collection items, if any. |
static java.lang.String |
ATTR_INDEXVAR
Attribute for specifying the name of the variable to be exposed that indicates the 0-based index position into the Collection. |
static java.lang.String |
ATTR_ITEMS
Attribute for specifying the Collection over which to
iterate. |
static java.lang.String |
ATTR_LIMIT
Attribute for specifying the number of iterations to be displayed. |
static java.lang.String |
ATTR_ORDER_BY
Attribute for specifying the property or properties by which to order the Collection items, if any. |
static java.lang.String |
ATTR_VAR
Attribute for specifying the "looping variable" name. |
static java.lang.String |
ATTR_WHERE
Attribute for specifying the condition that filters the Collection contents before display. |
| Fields inherited from class net.sf.jett.tag.BaseLoopTag |
|---|
ATTR_COLLAPSE, ATTR_COPY_RIGHT, ATTR_FIXED, ATTR_GROUP_DIR, ATTR_ON_LOOP_PROCESSED, ATTR_PAST_END_ACTION, GROUP_DIR_COLS, GROUP_DIR_NONE, GROUP_DIR_ROWS, PAST_END_ACTION_CLEAR, PAST_END_ACTION_REMOVE |
| Fields inherited from class net.sf.jett.tag.BaseTag |
|---|
ATTR_ON_PROCESSED, SPEC_SEP |
| Constructor Summary | |
|---|---|
ForEachTag()
|
|
| Method Summary | |
|---|---|
protected void |
afterBlockProcessed(TagContext context,
Block currBlock,
java.lang.Object item,
int index)
Remove the Iterator item from the Map of beans. |
protected void |
beforeBlockProcessed(TagContext context,
Block currBlock,
java.lang.Object item,
int index)
Place the Iterator 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 ForEachTag. |
protected int |
getCollectionSize()
Returns the size of the collection being iterated. |
protected java.util.Iterator<java.lang.Object> |
getLoopIterator()
Returns an Iterator that iterates over some
Collection of objects. |
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. |
void |
validateAttributes()
Validates the attributes for this Tag. |
| Methods inherited from class net.sf.jett.tag.BaseLoopTag |
|---|
getPastEndAction, process, setCollapsed, setCopyRight, setFixed, setGroupDirection, setOnLoopProcessed, setPastEndAction |
| Methods inherited from class net.sf.jett.tag.BaseTag |
|---|
checkAttributes, clearBlock, deleteBlock, getAttributes, getContext, getWorkbookContext, isBodiless, processTag, removeBlock, setAttributes, setBodiless, setContext, setWorkbookContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ATTR_ITEMS
Collection over which to
iterate.
public static final java.lang.String ATTR_VAR
public static final java.lang.String ATTR_INDEXVAR
Collection.
public static final java.lang.String ATTR_WHERE
Collection contents before display.
public static final java.lang.String ATTR_LIMIT
public static final java.lang.String ATTR_GROUP_BY
Collection items, if any.
public static final java.lang.String ATTR_ORDER_BY
Collection items, if any.
| Constructor Detail |
|---|
public ForEachTag()
| Method Detail |
|---|
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 "items"
attribute must be a Collection. The "limit", if present,
must be a non-negative integer.
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 ForEachTag.
getCollectionNames in class BaseLoopTagList of one collection name.protected int getNumIterations()
getNumIterations in class BaseLoopTagprotected int getCollectionSize()
getCollectionSize in class BaseLoopTagprotected java.util.Iterator<java.lang.Object> getLoopIterator()
Iterator that iterates over some
Collection of objects.
getLoopIterator in class BaseLoopTagIterator.
protected void beforeBlockProcessed(TagContext context,
Block currBlock,
java.lang.Object item,
int index)
Iterator item into the 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)
Iterator item from the 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||