public interface

Tag

implements EnumHTMLTags
com.microstrategy.web.tags.Tag
Known Indirect Subclasses

Class Overview

The Tag interface represents a generic XHTML tag in MicroStrategy LayoutTransform. Any specialized tag should derive from this interface.

When extending this interface, cares must be taken for the rendering method, such as render(MarkupOutput, LayoutContext), etc.

See also reference to TagsFactory.

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.web.tags.EnumHTMLTags
Public Methods
abstract Tag addChild(String tagName)
Adds a child tag with the speicified tag name.
abstract MarkupOutput addChild(MarkupOutput markup)
Adds a MarkupOutput instance as a child of the current tag.
abstract Tag addChild(Tag tag)
Adds a child tag.
abstract String addTextChild(String text)
Adds a text as a child of the current tag.
abstract void doEndTag(LayoutContext context)
This method is called after the rendering method renderCloseTag(MarkupOutput) is called to render the closing part of a tag, such as "
".
abstract void doStartTag(LayoutContext context)
This method is called before the rendering method renderOpenTag(MarkupOutput, LayoutContext) is called to render the opening part of a tag, such as "".
abstract String getAttribute(String attrName)
Returns the attribute value with the specified attribute name.
abstract Enumeration getAttributeNames()
Returns a Enumeration of attributes of the current tag.
abstract Enumeration getChildren()
Returns a Enumeration of children of the current tag.
abstract MarkupOutput getContent()
Returns a new MarkupOutput instance and Adds it as a child of the current tag.
abstract String getCssClass()
Returns the Cascading Style Sheets class name associated with the current tag.
abstract Tag getDeepCopy()
Returns a deep copy of this tag
abstract String getId()
Returns the ID attribute value of the current tag.
abstract int getLineNumber()
Returns the line number of the current tag in the layout source.
abstract boolean getPreserveCase()
Gets the character cases when rendering the tag name and attribute name.
abstract Tag getRootTag()
Returns the root tag in the tag hierarchical tree.
abstract boolean getSealed()
Returns a boolean value indicating whether the current tag is read-only.
abstract String getStyle()
Returns the value of the style attribute.
abstract String getTagName()
Returns the name of the current tag.
abstract boolean isClosedRequired()
Returns a boolean value indicating whether a closing tag, which looks like </foo>, is required when rendering the current tag.
abstract boolean isContentInline()
Returns a boolean value indicating whether the rendering result of the current tag needs to be written in a single line.
abstract boolean isDynamic()
Returns a boolean value indicating whether the current tag is dynamic.
abstract void removeChildren()
Remove any existing child tag from this tag.
abstract void render(MarkupOutput markup)
Renders the current tag including all its children tags and stores the rendering result in the specified MarkupOutput instance.
abstract void render(MarkupOutput markup, LayoutContext context)
Renders the current tag including all its children tagas and stores the rendering result in the specified MarkupOutput object.
abstract void renderCloseTag(MarkupOutput markup)
Renders the closing tag of the current tag and stores the rendering result in the specified MarkupOutput object.
abstract void renderOpenTag(MarkupOutput markup)
Renders the openning tag of the current tag ans store the rendering result in the specified MarkupOutput object.
abstract void renderOpenTag(MarkupOutput markup, LayoutContext context)
Renders the openning tag of the current tag and stores the rendering result in the specified MarkupOutput object.
abstract void replaceContent(Tag srcTag)
Replace the current tag's content with the srcTag's content
abstract void setAttribute(String attrName, String attrValue)
Sets a new value to the attribute with the specified attribute name.
abstract void setAttributes(Map attributes)
Sets a Map of attributes to the current tag.
abstract void setCssClass(String css)
Sets a class name for the Cascading Style Sheets attribute on the current tag.
abstract void setDynamic(boolean dyn)
Sets a boolean value indicating whether the current tag is dynamic.
abstract void setId(String id)
Sets a value to the ID attribute on the current tag.
abstract void setIsClosedRequired(boolean closeReq)
Sets a boolean value indicating whether a closing tag, which looks like </foo>, is required when rendering the current tag.
abstract void setIsContentInline(boolean inline)
Sets a boolean value indicating whether the rendering result of the current tag needs to be written in a single line.
abstract void setLineNumber(int lineNumber)
Sets the line number of the current tag in the layout source.
abstract void setPreserveCase(boolean preserveCase)
Sets the character cases when rendering the tag name and attribute name.
abstract void setRootTag(Tag root)
Sets a root tag of the tag tree to which the current tag belongs.
abstract void setSealed()
Marks the current tag as read-only.
abstract void setStyle(String style)
Set a value to the style attribute.
abstract void setTagName(String name)
Sets the current tag name.

Public Methods

public abstract Tag addChild (String tagName)

Adds a child tag with the speicified tag name.

Parameters
tagName the child tag name.
Returns
  • the child tag just being added.
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract MarkupOutput addChild (MarkupOutput markup)

Adds a MarkupOutput instance as a child of the current tag.

Parameters
markup a MarkupOutput instance to be added.
Returns
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract Tag addChild (Tag tag)

Adds a child tag.

Parameters
tag the child tag to be added.
Returns
  • the child tag just being added.
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract String addTextChild (String text)

Adds a text as a child of the current tag.

Parameters
text a text string to be added.
Returns
  • the text just being added.
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract void doEndTag (LayoutContext context)

This method is called after the rendering method renderCloseTag(MarkupOutput) is called to render the closing part of a tag, such as "". It is recommended to put all the cleaning work in this method that does not require rendering to the MarkupOutput object.

Parameters
context the LayoutContext object within which the rendering occurs.

public abstract void doStartTag (LayoutContext context)

This method is called before the rendering method renderOpenTag(MarkupOutput, LayoutContext) is called to render the opening part of a tag, such as "

". It is recommended to put all the preparations in this method that does not require rendering to the MarkupOutput object.

Parameters
context the LayoutContext object within which the rendering occurs.

public abstract String getAttribute (String attrName)

Returns the attribute value with the specified attribute name. Null is returned if there is no such an attribute.

Parameters
attrName the attribute name.
Returns
  • the attribute value with the specified name.

public abstract Enumeration getAttributeNames ()

Returns a Enumeration of attributes of the current tag.

Returns
  • a Enumeration of attributes of the current tag.

public abstract Enumeration getChildren ()

Returns a Enumeration of children of the current tag.

Returns
  • a Enumeration of children of the current tag.

public abstract MarkupOutput getContent ()

Returns a new MarkupOutput instance and Adds it as a child of the current tag. If the last child is a MarkupOutput object, just returns that one for the sake of memory consumption and performance.

Returns
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract String getCssClass ()

Returns the Cascading Style Sheets class name associated with the current tag. It is equivalent to call the method getAttribute(ATT_CLASS).

Returns
  • the Cascading Style Sheets class name.

public abstract Tag getDeepCopy ()

Returns a deep copy of this tag

Returns
  • Tag - This tag is a full copy of the current tag

public abstract String getId ()

Returns the ID attribute value of the current tag. It is equivalent to call the method getAttribute(ATT_ID).

Returns
  • the value of the ID attribute.

public abstract int getLineNumber ()

Returns the line number of the current tag in the layout source.

Returns
  • the line number of the current tag in the layout source.

public abstract boolean getPreserveCase ()

Gets the character cases when rendering the tag name and attribute name.

public abstract Tag getRootTag ()

Returns the root tag in the tag hierarchical tree.

Returns
  • the root tag of the tree to which the current tag belongs.

public abstract boolean getSealed ()

Returns a boolean value indicating whether the current tag is read-only.

Returns
  • true to indicate that the current tag is read-only.

public abstract String getStyle ()

Returns the value of the style attribute. It is equivalent to call the method getAttribute(ATT_STYLE).

Returns
  • the style attribute value.

public abstract String getTagName ()

Returns the name of the current tag.

Returns
  • the current tag name.

public abstract boolean isClosedRequired ()

Returns a boolean value indicating whether a closing tag, which looks like </foo>, is required when rendering the current tag.

Returns
  • true to indicate that a closing tag is required.

public abstract boolean isContentInline ()

Returns a boolean value indicating whether the rendering result of the current tag needs to be written in a single line.

Returns
  • true to indicate that a single line of the rendering result is preferred.

public abstract boolean isDynamic ()

Returns a boolean value indicating whether the current tag is dynamic. A dynamic tag might not get its opening tag rendered when the LayoutContext object is not null.

Returns
  • true to indicate that the current tag is dynamic.

public abstract void removeChildren ()

Remove any existing child tag from this tag.

public abstract void render (MarkupOutput markup)

Renders the current tag including all its children tags and stores the rendering result in the specified MarkupOutput instance.

Parameters
markup the MarkupOutput object to store the rendering result.

public abstract void render (MarkupOutput markup, LayoutContext context)

Renders the current tag including all its children tagas and stores the rendering result in the specified MarkupOutput object.

Parameters
markup the MarkupOutput object to store the rendering result.
context the LayoutContext object within which the rendering occurs.
Throws
MalformedMethodException thrown if error occurs at rendering.

public abstract void renderCloseTag (MarkupOutput markup)

Renders the closing tag of the current tag and stores the rendering result in the specified MarkupOutput object.

Parameters
markup the MarkupOutput object to store the rendering result.

public abstract void renderOpenTag (MarkupOutput markup)

Renders the openning tag of the current tag ans store the rendering result in the specified MarkupOutput object.

Parameters
markup the MarkupOutput object to store the rendering result.

public abstract void renderOpenTag (MarkupOutput markup, LayoutContext context)

Renders the openning tag of the current tag and stores the rendering result in the specified MarkupOutput object.

Parameters
markup the MarkupOutput object to store the rendering result.
context the LayoutContext object within which the rendering occurs.
Throws
MalformedMethodException thrown if error occurs at rendering.

public abstract void replaceContent (Tag srcTag)

Replace the current tag's content with the srcTag's content

Parameters
srcTag Tag - The source tag which provides the content to replace with

public abstract void setAttribute (String attrName, String attrValue)

Sets a new value to the attribute with the specified attribute name. If the specified attribute does not exist in the current tag, adds it. If the specified attribute value is null, removes the attribute from the current tag.

Parameters
attrName the name of the attribute
attrValue the value of the attribute
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract void setAttributes (Map attributes)

Sets a Map of attributes to the current tag. The Map contains pairs of attribute name and value.

Parameters
attributes a Map of attributes
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract void setCssClass (String css)

Sets a class name for the Cascading Style Sheets attribute on the current tag. It is equivalent to call the method setAttribute(ATT_CLASS, css)

Parameters
css the class name of the Cascading Style Sheets attribute
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract void setDynamic (boolean dyn)

Sets a boolean value indicating whether the current tag is dynamic. A dynamic tag might not get its opening tag rendered when the LayoutContext object is not null.

Parameters
dyn true to indicate that the current tag is dynamic.
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract void setId (String id)

Sets a value to the ID attribute on the current tag. It is equivalent to call the method setAttribute(ATT_ID, id).

Parameters
id the valud of the ID attribute.
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract void setIsClosedRequired (boolean closeReq)

Sets a boolean value indicating whether a closing tag, which looks like </foo>, is required when rendering the current tag.

Parameters
closeReq true to indicate that a closing tag is required.
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract void setIsContentInline (boolean inline)

Sets a boolean value indicating whether the rendering result of the current tag needs to be written in a single line.

Parameters
inline true to indicate that a single line of the rendering result is preferred.
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract void setLineNumber (int lineNumber)

Sets the line number of the current tag in the layout source.

Parameters
lineNumber the line number of the current tag in the layout source.
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract void setPreserveCase (boolean preserveCase)

Sets the character cases when rendering the tag name and attribute name. Default is false.

Parameters
preserveCase true to indicate case will be preserved when rendering of the tag name and attribute name. false to indicate the rendering of the tag name and attribute name will be in lower case.

public abstract void setRootTag (Tag root)

Sets a root tag of the tag tree to which the current tag belongs.

Parameters
root the root tag of the tag tree.
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract void setSealed ()

Marks the current tag as read-only.

public abstract void setStyle (String style)

Set a value to the style attribute. It is equivalent to call the method setAttribute(ATT_STYLE, style).

Parameters
style the style attribute value.
Throws
UnmodifiableException thrown if the current tag is read-only.

public abstract void setTagName (String name)

Sets the current tag name.

Parameters
name the tag name.
Throws
UnmodifiableException thrown if the current tag is read-only.