Tagpublic class IfTag extends BaseTag
An IfTag represents a conditionally placed
Block of Cells.
BaseTag.booleanRichTextStringRichTextStringString| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
ATTR_ELSE |
Attribute for specifying the value of the
Cell if the
condition is false (bodiless if-tag only). |
static java.lang.String |
ATTR_ELSE_ACTION |
Attribute for specifying the action to be taken if the condition is
false (if-tags with a body only). |
static java.lang.String |
ATTR_TEST |
Attribute for specifying the
boolean test condition. |
static java.lang.String |
ATTR_THEN |
Attribute for specifying the value of the
Cell if the
condition is true (bodiless if-tag only). |
static java.lang.String |
ELSE_ACTION_CLEAR |
Value for the "elseAction" attribute indicating to remove the block by
clearing cell contents and not shifting cells, if the test condition is
false.
|
static java.lang.String |
ELSE_ACTION_REMOVE |
Value for the "elseAction" attribute indicating to clear the block by
remove the cells, but not shifting other cells, if the test condition is
false.
|
static java.lang.String |
ELSE_ACTION_SHIFT_LEFT |
Value for the "elseAction" attribute indicating to remove the block by
shifting cells left, if the test condition is false.
|
static java.lang.String |
ELSE_ACTION_SHIFT_UP |
Value for the "elseAction" attribute indicating to remove the block by
shifting cells up, if the test condition is false.
|
ATTR_ON_PROCESSED, SPEC_SEP| Constructor | Description |
|---|---|
IfTag() |
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
getName() |
Returns this
Tag's name. |
protected java.util.List<java.lang.String> |
getOptionalAttributes() |
Returns a
List of optional attribute names. |
protected java.util.List<java.lang.String> |
getRequiredAttributes() |
Returns a
List of required attribute names. |
boolean |
process() |
Evaluate the condition.
|
void |
validateAttributes() |
Validates the attributes for this
Tag. |
checkAttributes, clearBlock, deleteBlock, getAttributes, getContext, getLocation, getParentTag, getWorkbookContext, isBodiless, processTag, removeBlock, setAttributes, setBodiless, setContext, setParentTag, setWorkbookContextpublic static final java.lang.String ELSE_ACTION_SHIFT_UP
public static final java.lang.String ELSE_ACTION_SHIFT_LEFT
public static final java.lang.String ELSE_ACTION_CLEAR
public static final java.lang.String ELSE_ACTION_REMOVE
public static final java.lang.String ATTR_TEST
boolean test condition.public static final java.lang.String ATTR_THEN
Cell if the
condition is true (bodiless if-tag only).public static final java.lang.String ATTR_ELSE
Cell if the
condition is false (bodiless if-tag only).public static final java.lang.String ATTR_ELSE_ACTION
false (if-tags with a body only).public java.lang.String getName()
Tag's name.Tag's name.protected java.util.List<java.lang.String> getRequiredAttributes()
List of required attribute names.getRequiredAttributes in class BaseTagList of required attribute names.protected java.util.List<java.lang.String> getOptionalAttributes()
List of optional attribute names.getOptionalAttributes in class BaseTagList of optional attribute names.public void validateAttributes()
Tag. Some optional
attributes are only valid for bodiless tags, and others are only valid
for tags without bodies.validateAttributes in class BaseTagpublic boolean process()
Evaluate the condition.
With Body: If it's true, transform the block of Cells.
If it's false, take the "elseAction", which defaults to removing the
block.
Bodiless: If it's true, evaluate the "then" condition. If it's false, evaluate the "else" condition, which defaults to a value of null.
Copyright © 2012–2018 Jett Team. All rights reserved.