|
||||||||||
| 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
public abstract class BaseLoopTag
The abstract class BaseLoopTag is the base class for all tags
that represent loops.
BaseTag.booleanbooleanStringStringbooleanTagLoopListener
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_COLLAPSE
Attribute for specifying whether the group should be displayed collapsed. |
static java.lang.String |
ATTR_COPY_RIGHT
Attribute for forcing "copy right" behavior. |
static java.lang.String |
ATTR_FIXED
Attribute for not shifting other content out of the way; works the same as "fixed size collections". |
static java.lang.String |
ATTR_GROUP_DIR
Attribute for specifying the direction of the grouping. |
static java.lang.String |
ATTR_ON_LOOP_PROCESSED
Attribute for specifying a TagLoopListener to listen for
TagLoopEvents. |
static java.lang.String |
ATTR_PAST_END_ACTION
Attribute for specifying the "past end action", an action for dealing with content beyond the range of looping content. |
static java.lang.String |
GROUP_DIR_COLS
The "group dir" value to specify that columns should be grouped. |
static java.lang.String |
GROUP_DIR_NONE
The "group dir" value to specify that neither rows nor columns should be grouped. |
static java.lang.String |
GROUP_DIR_ROWS
The "group dir" value to specify that rows should be grouped. |
static java.lang.String |
PAST_END_ACTION_CLEAR
The "past end action" value to clear the content of cells. |
static java.lang.String |
PAST_END_ACTION_REMOVE
The "past end action" value to remove the cells, including things like borders and formatting. |
| Fields inherited from class net.sf.jett.tag.BaseTag |
|---|
ATTR_ON_PROCESSED, SPEC_SEP |
| Constructor Summary | |
|---|---|
BaseLoopTag()
|
|
| Method Summary | |
|---|---|
protected abstract void |
afterBlockProcessed(TagContext context,
Block currBlock,
java.lang.Object item,
int index)
This method is called once per iteration loop, immediately after the given Block is processed. |
protected abstract void |
beforeBlockProcessed(TagContext context,
Block currBlock,
java.lang.Object item,
int index)
This method is called once per iteration loop, immediately before the given Block is processed. |
protected abstract java.util.List<java.lang.String> |
getCollectionNames()
Returns the names of the Collections that are being used in
this BaseLoopTag. |
protected abstract int |
getCollectionSize()
Returns the size of the collection being iterated. |
protected abstract java.util.Iterator<?> |
getLoopIterator()
Returns an Iterator that iterates over some
Collection of objects. |
protected abstract int |
getNumIterations()
Returns the number of iterations. |
protected java.util.List<java.lang.String> |
getOptionalAttributes()
All BaseLoopTags support the optional copy down tag. |
protected PastEndAction |
getPastEndAction()
Returns the PastEndAction, which is controlled by the
attribute specified by ATTR_PAST_END_ACTION. |
protected java.util.List<java.lang.String> |
getRequiredAttributes()
There are no required attributes that all BaseLoopTags
support. |
boolean |
process()
Provide a generic way to process a tag that loops, with the Template Method pattern. |
void |
setCollapsed(boolean collapsed)
Sets whether any Excel Group created is collapsed. |
void |
setCopyRight(boolean copyRight)
Sets whether the repeated blocks are to be copied to the right (true) or downward (default, false). |
void |
setFixed(boolean fixed)
Sets "fixed" mode, which doesn't shift other content out of the way when copying repeated blocks of cells. |
void |
setGroupDirection(Block.Direction direction)
Sets the directionality of the Excel Group to be created, if any. |
void |
setOnLoopProcessed(TagLoopListener listener)
Sets the TagLoopListener. |
void |
setPastEndAction(PastEndAction pae)
Sets the PastEndAction. |
protected void |
validateAttributes()
Ensure that the past end action (if specified) is a valid value. |
| 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 |
| Methods inherited from interface net.sf.jett.tag.Tag |
|---|
getName |
| Field Detail |
|---|
public static final java.lang.String ATTR_COPY_RIGHT
public static final java.lang.String ATTR_FIXED
public static final java.lang.String ATTR_PAST_END_ACTION
PAST_END_ACTION_CLEAR,
PAST_END_ACTION_REMOVE,
Constant Field Valuespublic static final java.lang.String ATTR_GROUP_DIR
GROUP_DIR_ROWS,
GROUP_DIR_COLS,
GROUP_DIR_NONE,
Constant Field Valuespublic static final java.lang.String ATTR_COLLAPSE
false, for not collapsed. It is ignored if
neither rows nor columns are being grouped.
public static final java.lang.String ATTR_ON_LOOP_PROCESSED
TagLoopListener to listen for
TagLoopEvents.
public static final java.lang.String PAST_END_ACTION_CLEAR
public static final java.lang.String PAST_END_ACTION_REMOVE
public static final java.lang.String GROUP_DIR_COLS
public static final java.lang.String GROUP_DIR_ROWS
public static final java.lang.String GROUP_DIR_NONE
| Constructor Detail |
|---|
public BaseLoopTag()
| Method Detail |
|---|
public void setCopyRight(boolean copyRight)
copyRight - Whether the repeated blocks are to be copied to the right (true) or
downward (default, false).public void setFixed(boolean fixed)
fixed - Whether to execute in "fixed" mode.public void setPastEndAction(PastEndAction pae)
PastEndAction.
pae - The PastEndAction.public void setGroupDirection(Block.Direction direction)
direction - The directionality.public void setCollapsed(boolean collapsed)
collapsed - Whether any Excel group created is collapsed.public void setOnLoopProcessed(TagLoopListener listener)
TagLoopListener.
listener - The TagLoopListener.protected java.util.List<java.lang.String> getRequiredAttributes()
BaseLoopTags
support.
getRequiredAttributes in class BaseTagList.protected java.util.List<java.lang.String> getOptionalAttributes()
BaseLoopTags support the optional copy down tag.
getOptionalAttributes in class BaseTagList of optional attribute names.
protected void validateAttributes()
throws TagParseException
validateAttributes in class BaseTagTagParseException - If the attribute values are illegal or
unacceptable.protected PastEndAction getPastEndAction()
PastEndAction, which is controlled by the
attribute specified by ATTR_PAST_END_ACTION. It defaults to
CLEAR_CELL.
PastEndAction.PastEndActionpublic boolean process()
Provide a generic way to process a tag that loops, with the Template Method pattern.
getCollectionNames() to determine if any of the collection
names are "fixed".getNumIterations to determine the number of Blocks
needed.getLoopIterator().Block for the iteration.beforeBlockProcessed()Block with a
BlockTransformer.afterBlockProcessed()
process in class BaseTagCell in the Block
associated with this Tag was processed.getCollectionNames(),
getNumIterations(),
getLoopIterator(),
beforeBlockProcessed(net.sf.jett.tag.TagContext, net.sf.jett.model.Block, java.lang.Object, int),
afterBlockProcessed(net.sf.jett.tag.TagContext, net.sf.jett.model.Block, java.lang.Object, int)protected abstract java.util.List<java.lang.String> getCollectionNames()
Collections that are being used in
this BaseLoopTag.
List collection names, or null if
not operating on any Collections.protected abstract int getNumIterations()
protected abstract int getCollectionSize()
protected abstract java.util.Iterator<?> getLoopIterator()
Iterator that iterates over some
Collection of objects. The Iterator doesn't
need to support the remove operation.
Iterator.
protected abstract void beforeBlockProcessed(TagContext context,
Block currBlock,
java.lang.Object item,
int index)
Block is processed. An iteration index is supplied as
well.
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 abstract void afterBlockProcessed(TagContext context,
Block currBlock,
java.lang.Object item,
int index)
Block is processed. An iteration index is supplied as
well.
context - The TagContext.currBlock - The Block that was just processed.item - The Object that resulted from the iterator.index - The iteration index (0-based).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||