|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jett.tag.BaseTag
public abstract class BaseTag
The abstract class BaseTag provides common functionality to
all Tags.
TagListener
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_ON_PROCESSED
Attribute for specifying a TagListener to listen for
TagEvents. |
static java.lang.String |
SPEC_SEP
Separates expressions in attributes that take multiple values. |
| Constructor Summary | |
|---|---|
BaseTag()
|
|
| Method Summary | |
|---|---|
void |
checkAttributes()
Checks the Tag's attributes to ensure that: |
protected void |
clearBlock()
Clears the content from the Block of Cells
associated with this Tag. |
protected void |
deleteBlock()
Removes the content from the Block of Cells
associated with this Tag. |
java.util.Map<java.lang.String,org.apache.poi.ss.usermodel.RichTextString> |
getAttributes()
Returns the Map of attribute names and attribute values. |
TagContext |
getContext()
Returns the TagContext to which the Tag is
associated. |
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. |
WorkbookContext |
getWorkbookContext()
Returns the WorkbookContext to which the Tag is
associated. |
boolean |
isBodiless()
Returns whether this Tag is bodiless. |
abstract boolean |
process()
Process this Tag. |
boolean |
processTag()
Validates all attributes and attribute values. |
protected void |
removeBlock()
Removes the Block of Cells associated with this
Tag. |
void |
setAttributes(java.util.Map<java.lang.String,org.apache.poi.ss.usermodel.RichTextString> attributes)
When a Tag is created, the attributes are passed in via a
(possibly empty) Map of attribute names and values. |
void |
setBodiless(boolean bodiless)
Sets whether this Tag is bodiless. |
void |
setContext(TagContext context)
Sets the TagContext to which the Tag is
associated. |
void |
setWorkbookContext(WorkbookContext context)
Sets the WorkbookContext to which the Tag is
associated. |
protected void |
validateAttributes()
Validates the attributes according to Tag-specific rules. |
| 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_ON_PROCESSED
TagListener to listen for
TagEvents.
public static final java.lang.String SPEC_SEP
| Constructor Detail |
|---|
public BaseTag()
| Method Detail |
|---|
public void setAttributes(java.util.Map<java.lang.String,org.apache.poi.ss.usermodel.RichTextString> attributes)
Tag is created, the attributes are passed in via a
(possibly empty) Map of attribute names and values.
setAttributes in interface Tagattributes - A Map of attribute names and values.public java.util.Map<java.lang.String,org.apache.poi.ss.usermodel.RichTextString> getAttributes()
Map of attribute names and attribute values.
getAttributes in interface TagMap of attribute names and attribute values.public void setContext(TagContext context)
TagContext to which the Tag is
associated.
setContext in interface Tagcontext - A TagContext.public WorkbookContext getWorkbookContext()
WorkbookContext to which the Tag is
associated.
getWorkbookContext in interface TagWorkbookContext.public void setWorkbookContext(WorkbookContext context)
WorkbookContext to which the Tag is
associated.
setWorkbookContext in interface Tagcontext - A WorkbookContext.public TagContext getContext()
TagContext to which the Tag is
associated.
getContext in interface TagTagContext.public void setBodiless(boolean bodiless)
Tag is bodiless.
setBodiless in interface Tagbodiless - true if this tag does not have a body,
false if this tag does have a body.public boolean isBodiless()
Tag is bodiless.
isBodiless in interface Tagtrue if this tag does not have a body,
false if this tag does have a body.public void checkAttributes()
Checks the Tag's attributes to ensure that:
validateAttributes (i.e. that method doesn't throw an
Exception.
A TagParseException is thrown if not all conditions above
are not met.
This calls validateAttributes if all conditions are met.
TagParseException - If the above listed conditions are not met.validateAttributes()public boolean processTag()
Validates all attributes and attribute values. Processes this
Tag.
For 0.3.0, the methods "checkAttributes" and "process" were removed and replaced by this method, to allow for additional logic.
processTag in interface Tagtrue if the Cell containing this
Tag was transformed, false if it needs to be
transformed again. This may happen if the Block
associated with the Tag was removed.
TagParseException - If all required
attributes are not present, if there is an unrecognized attribute or
attribute value, or if any tag data is unacceptable in any other way.protected void removeBlock()
Block of Cells associated with this
Tag. This can be called by subclasses if it determines that
its Block needs to be removed and not processed.
protected void deleteBlock()
Block of Cells
associated with this Tag. This can be called by subclasses
if it determines that its Block needs to have its content
removed.
protected void clearBlock()
Block of Cells
associated with this Tag. This can be called by subclasses
if it determines that its Block needs its contents cleared.
protected java.util.List<java.lang.String> getRequiredAttributes()
List of required attribute names. Subclasses that
want to add to this list must override this method, call
super.getRequiredAttributes, and add their own required
attributes.
List of required attribute names.protected java.util.List<java.lang.String> getOptionalAttributes()
List of optional attribute names. Subclasses that
want to add to this list must override this method, call
super.getOptionalAttributes, and add their own optional
attributes.
List of optional attribute names.
protected void validateAttributes()
throws TagParseException
Tag-specific rules.
Subclasses that want to add to validate their own attributes, as well as
these attributes, must override this method, call
super.validateAttributes, and then validate their own
attributes.
TagParseException - If the attribute values are illegal or
unacceptable.public abstract boolean process()
Tag. The logic of the Tag is
performed in this method.
true if the Cell containing this
Tag was transformed, false if it needs to be
transformed again. This may happen if the Block
associated with the Tag was removed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||