net.sf.jett.tag
Interface Tag

All Known Implementing Classes:
AggTag, BaseLoopTag, BaseTag, CommentTag, ForEachTag, FormulaTag, ForTag, GroupTag, HyperlinkTag, IfTag, MultiForEachTag, NullTag, SpanTag, StyleTag, TotalTag

public interface Tag

A Tag represents an XML tag that can reside in a Cell. A Tag represents special processing inside its own Block of Cells (the tag "body"). Each Tag is responsible for processing its own Block.

Any concrete subclass of Tag must have a public, no-argument constructor.

Author:
Randy Gettman

Method Summary
 java.util.Map<java.lang.String,org.apache.poi.ss.usermodel.RichTextString> getAttributes()
          A Tag can retrieve its attributes by calling this method.
 TagContext getContext()
          Returns the TagContext to which the Tag is associated.
 java.lang.String getName()
          Returns the name of the Tag.
 WorkbookContext getWorkbookContext()
          Returns the WorkbookContext to which the Tag is associated.
 boolean isBodiless()
          Returns whether this Tag is bodiless.
 boolean processTag()
          Validates all attributes and attribute values.
 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.
 

Method Detail

getName

java.lang.String getName()
Returns the name of the Tag.

Returns:
The name of the Tag.

setAttributes

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.

Parameters:
attributes - A Map of attribute names and values.

setBodiless

void setBodiless(boolean bodiless)
Sets whether this Tag is bodiless.

Parameters:
bodiless - true if this tag does not have a body, false if this tag does have a body.

isBodiless

boolean isBodiless()
Returns whether this Tag is bodiless.

Returns:
true if this tag does not have a body, false if this tag does have a body.

getAttributes

java.util.Map<java.lang.String,org.apache.poi.ss.usermodel.RichTextString> getAttributes()
A Tag can retrieve its attributes by calling this method.

Returns:
A Map of attribute names and attribute values.

setContext

void setContext(TagContext context)
Sets the TagContext to which the Tag is associated.

Parameters:
context - A TagContext.

getContext

TagContext getContext()
Returns the TagContext to which the Tag is associated.

Returns:
The associated TagContext.

setWorkbookContext

void setWorkbookContext(WorkbookContext context)
Sets the WorkbookContext to which the Tag is associated.

Parameters:
context - A WorkbookContext.

getWorkbookContext

WorkbookContext getWorkbookContext()
Returns the WorkbookContext to which the Tag is associated.

Returns:
The associated WorkbookContext.

processTag

boolean processTag()

Validates all attributes and attribute values. Processes this Tag.

For 0.3.0, the methods "checkAttributes" and "process" were removed and replace by this method, to allow for additional logic. The methods still exist in BaseTag, where they are called by a concrete processTag method.

Returns:
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.
Throws:
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.
Since:
0.3.0


Copyright © 2012-2013 Jett Team. All Rights Reserved.