Package com.microstrategy.web.tags
Interface Tag
-
- All Superinterfaces:
EnumHTMLTags
- All Known Subinterfaces:
AnchorTag
,ArgumentTag
,AttrTag
,BaseTag
,CellTag
,DisplayTag
,DynamicTag
,IfTag
,ImageTag
,IncludeTag
,InputTag
,LayoutTag
,ListTag
,NextTag
,OnExceptionTag
,RenderTag
,ReplaceTag
,RowTag
,SelectTag
,SlotTag
,TableTag
,ValuefulTag
- All Known Implementing Classes:
AnchorTagImpl
,AnchorWebTag
,BaseTagImpl
,DisplayTagImpl
,IFrameOutputTag
,IncludeTagImpl
,JUILLayoutsTagImpl
,JUILLayoutsTagImpl
,ReplaceTagImpl
,RootBlockTagImpl
,ScriptTagImpl
,SlotTagImpl
,TagImpl
,WebBlockAppendListTagImpl
,WebBlockContextTagImpl
,WebBlockDeletePropertyTagImpl
,WebBlockEditBlockTagImpl
,WebBlockEditListTagImpl
,WebBlockEditTagImpl
,WebBlockListTagImpl
,WebBlockSetPropertyTagImpl
,WebBlockTagImpl
public interface Tag extends EnumHTMLTags
TheTag
interface represents a generic XHTML tag in MicroStrategyLayoutTransform
. 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
.- Since:
- MicroStrategy Web 8.0.0
-
-
Field Summary
-
Fields inherited from interface com.microstrategy.web.tags.EnumHTMLTags
ATT_ACTION, ATT_ALIGN, ATT_ALT, ATT_AUTOCOMPLETE, ATT_BORDER, ATT_CELLPADDING, ATT_CELLSPACING, ATT_CHECKED, ATT_CLASS, ATT_CMD_FORMAT_TYPE, ATT_CMDID, ATT_CMDLVL, ATT_COLS, ATT_COLSPAN, ATT_DG, ATT_DIALOG, ATT_DISABLED, ATT_FOR, ATT_HEIGHT, ATT_HREF, ATT_HSPACE, ATT_ID, ATT_IFRAME, ATT_LANGUAGE, ATT_MAXLENGTH, ATT_METHOD, ATT_MODAL, ATT_NAME, ATT_NOWRAP, ATT_ONCHANGE, ATT_ONCLICK, ATT_ONFOCUS, ATT_ONKEYDOWN, ATT_ONKEYUP, ATT_ONMOUSEOUT, ATT_ONMOUSEOVER, ATT_ONSUBMIT, ATT_PARAM, ATT_PLACEHOLDER, ATT_READONLY, ATT_REL, ATT_ROWS, ATT_ROWSPAN, ATT_SCRIPT_CLASS, ATT_SELECTED, ATT_SIZE, ATT_SRC, ATT_STYLE, ATT_SUMMARY, ATT_TARGET, ATT_TITLE, ATT_TY, ATT_TYPE, ATT_VALIGN, ATT_VALUE, ATT_VALUE_ABSBOTTOM, ATT_VALUE_ABSMIDDLE, ATT_VALUE_BOTTOM, ATT_VALUE_BUTTON, ATT_VALUE_CHECKBOX, ATT_VALUE_DEFAULT, ATT_VALUE_EMBED, ATT_VALUE_FALSE, ATT_VALUE_HIDDEN, ATT_VALUE_IMAGE, ATT_VALUE_JAVASCRIPT, ATT_VALUE_LEFT, ATT_VALUE_MAX, ATT_VALUE_MIDDLE, ATT_VALUE_MIN, ATT_VALUE_NUMBER, ATT_VALUE_POST, ATT_VALUE_RADIO, ATT_VALUE_SUBMIT, ATT_VALUE_TEXT, ATT_VALUE_TOP, ATT_VALUE_TRUE, ATT_VSPACE, ATT_WIDTH, TAG_NAME_ANCHOR, TAG_NAME_CELL, TAG_NAME_DIV, TAG_NAME_HEADER, TAG_NAME_IFRAME, TAG_NAME_IMAGE, TAG_NAME_INPUT, TAG_NAME_LABEL, TAG_NAME_MAP, TAG_NAME_OPTION, TAG_NAME_ROW, TAG_NAME_SCRIPT, TAG_NAME_SELECT, TAG_NAME_SPAN, TAG_NAME_STYLE, TAG_NAME_TABLE, TAG_NAME_TBODY, TAG_NAME_TEXTAREA, TAG_NAME_THEAD
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MarkupOutput
addChild(MarkupOutput markup)
Adds aMarkupOutput
instance as a child of the current tag.Tag
addChild(Tag tag)
Adds a child tag.Tag
addChild(java.lang.String tagName)
Adds a child tag with the speicified tag name.java.lang.String
addTextChild(java.lang.String text)
Adds a text as a child of the current tag.java.lang.String
addTextChild(java.lang.String text, boolean encode)
Adds a text as a child of the current tag.void
doEndTag(LayoutContext context)
This method is called after the rendering methodrenderCloseTag(MarkupOutput)
is called to render the closing part of a tag, such as "".void
doStartTag(LayoutContext context)
This method is called before the rendering methodrenderOpenTag(MarkupOutput, LayoutContext)
is called to render the opening part of a tag, such as "".java.lang.String
getAttribute(java.lang.String attrName)
Returns the attribute value with the specified attribute name.java.util.Enumeration
getAttributeNames()
Returns aEnumeration
of attributes of the current tag.java.util.Enumeration
getChildren()
Returns aEnumeration
of children of the current tag.MarkupOutput
getContent()
Returns a newMarkupOutput
instance and Adds it as a child of the current tag.java.lang.String
getCssClass()
Returns theCascading Style Sheets
class name associated with the current tag.Tag
getDeepCopy()
Returns a deep copy of this tagjava.lang.String
getId()
Returns the ID attribute value of the current tag.int
getLineNumber()
Returns the line number of the current tag in the layout source.boolean
getPreserveCase()
Gets the character cases when rendering the tag name and attribute name.Tag
getRootTag()
Returns the root tag in the tag hierarchical tree.boolean
getSealed()
Returns a boolean value indicating whether the current tag is read-only.java.lang.String
getStyle()
Returns the value of the style attribute.java.lang.String
getTagName()
Returns the name of the current tag.boolean
isClosedRequired()
Returns a boolean value indicating whether a closing tag, which looks like</foo>
, is required when rendering the current tag.boolean
isContentInline()
Returns a boolean value indicating whether the rendering result of the current tag needs to be written in a single line.boolean
isDynamic()
Returns a boolean value indicating whether the current tag is dynamic.void
removeChildren()
Remove any existing child tag from this tag.void
render(MarkupOutput markup)
Renders the current tag including all its children tags and stores the rendering result in the specifiedMarkupOutput
instance.void
render(MarkupOutput markup, LayoutContext context)
Renders the current tag including all its children tagas and stores the rendering result in the specifiedMarkupOutput
object.void
renderCloseTag(MarkupOutput markup)
Renders the closing tag of the current tag and stores the rendering result in the specifiedMarkupOutput
object.void
renderOpenTag(MarkupOutput markup)
Renders the openning tag of the current tag ans store the rendering result in the specifiedMarkupOutput
object.void
renderOpenTag(MarkupOutput markup, LayoutContext context)
Renders the openning tag of the current tag and stores the rendering result in the specifiedMarkupOutput
object.void
replaceContent(Tag srcTag)
Replace the current tag's content with the srcTag's contentvoid
setAttribute(java.lang.String attrName, java.lang.String attrValue)
Sets a new value to the attribute with the specified attribute name.void
setAttributes(java.util.Map attributes)
Sets aMap
of attributes to the current tag.void
setCssClass(java.lang.String css)
Sets a class name for the Cascading Style Sheets attribute on the current tag.void
setDynamic(boolean dyn)
Sets a boolean value indicating whether the current tag is dynamic.void
setId(java.lang.String id)
Sets a value to the ID attribute on the current tag.void
setIsClosedRequired(boolean closeReq)
Sets a boolean value indicating whether a closing tag, which looks like</foo>
, is required when rendering the current tag.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.void
setLineNumber(int lineNumber)
Sets the line number of the current tag in the layout source.void
setPreserveCase(boolean preserveCase)
Sets the character cases when rendering the tag name and attribute name.void
setRootTag(Tag root)
Sets a root tag of the tag tree to which the current tag belongs.void
setSealed()
Marks the current tag as read-only.void
setStyle(java.lang.String style)
Set a value to the style attribute.void
setTagName(java.lang.String name)
Sets the current tag name.
-
-
-
Method Detail
-
addChild
MarkupOutput addChild(MarkupOutput markup) throws UnmodifiableException
Adds aMarkupOutput
instance as a child of the current tag.- Parameters:
markup
- aMarkupOutput
instance to be added.- Returns:
- the
MarkupOutput
instance just being added. - Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
addChild
Tag addChild(java.lang.String tagName) throws UnmodifiableException
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.
-
addChild
Tag addChild(Tag tag) throws UnmodifiableException
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.
-
addTextChild
java.lang.String addTextChild(java.lang.String text) throws UnmodifiableException
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.
-
addTextChild
java.lang.String addTextChild(java.lang.String text, boolean encode) throws UnmodifiableException
Adds a text as a child of the current tag.- Parameters:
text
- a text string to be added.encode
- true if the text should be encoded- Returns:
- the text just being added.
- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
getAttribute
java.lang.String getAttribute(java.lang.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.
-
getContent
MarkupOutput getContent() throws UnmodifiableException
Returns a newMarkupOutput
instance and Adds it as a child of the current tag. If the last child is aMarkupOutput
object, just returns that one for the sake of memory consumption and performance.- Returns:
- a child
MarkupOutput
instance. - Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
getCssClass
java.lang.String getCssClass()
Returns theCascading Style Sheets
class name associated with the current tag. It is equivalent to call the methodgetAttribute(
.EnumHTMLTags.ATT_CLASS
)- Returns:
- the Cascading Style Sheets class name.
-
getId
java.lang.String getId()
Returns the ID attribute value of the current tag. It is equivalent to call the methodgetAttribute(
.EnumHTMLTags.ATT_ID
)- Returns:
- the value of the ID attribute.
-
getStyle
java.lang.String getStyle()
Returns the value of the style attribute. It is equivalent to call the methodgetAttribute(
.EnumHTMLTags.ATT_STYLE
)- Returns:
- the style attribute value.
-
getTagName
java.lang.String getTagName()
Returns the name of the current tag.- Returns:
- the current tag name.
-
isClosedRequired
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.
-
isContentInline
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.
-
render
void render(MarkupOutput markup)
Renders the current tag including all its children tags and stores the rendering result in the specifiedMarkupOutput
instance.- Parameters:
markup
- theMarkupOutput
object to store the rendering result.
-
render
void render(MarkupOutput markup, LayoutContext context) throws MalformedMethodException
Renders the current tag including all its children tagas and stores the rendering result in the specifiedMarkupOutput
object.- Parameters:
markup
- theMarkupOutput
object to store the rendering result.context
- theLayoutContext
object within which the rendering occurs.- Throws:
MalformedMethodException
- thrown if error occurs at rendering.
-
doStartTag
void doStartTag(LayoutContext context)
This method is called before the rendering methodrenderOpenTag(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
". It is recommended to put all the cleaning work in this method that does not require rendering to theMarkupOutput
object.- Parameters:
context
- theLayoutContext
object within which the rendering occurs.- Since:
- MicroStrategy Web 9.0.0
-
renderOpenTag
void renderOpenTag(MarkupOutput markup)
Renders the openning tag of the current tag ans store the rendering result in the specifiedMarkupOutput
object.- Parameters:
markup
- theMarkupOutput
object to store the rendering result.
-
renderOpenTag
void renderOpenTag(MarkupOutput markup, LayoutContext context) throws MalformedMethodException
Renders the openning tag of the current tag and stores the rendering result in the specifiedMarkupOutput
object.- Parameters:
markup
- theMarkupOutput
object to store the rendering result.context
- theLayoutContext
object within which the rendering occurs.- Throws:
MalformedMethodException
- thrown if error occurs at rendering.
-
renderCloseTag
void renderCloseTag(MarkupOutput markup)
Renders the closing tag of the current tag and stores the rendering result in the specifiedMarkupOutput
object.- Parameters:
markup
- theMarkupOutput
object to store the rendering result.
-
doEndTag
void doEndTag(LayoutContext context)
This method is called after the rendering methodrenderCloseTag(MarkupOutput)
is called to render the closing part of a tag, such as "
MarkupOutput
object.- Parameters:
context
- theLayoutContext
object within which the rendering occurs.- Since:
- MicroStrategy Web 9.0.0
-
setAttribute
void setAttribute(java.lang.String attrName, java.lang.String attrValue) throws UnmodifiableException
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 attributeattrValue
- the value of the attribute- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
setAttributes
void setAttributes(java.util.Map attributes) throws UnmodifiableException
Sets aMap
of attributes to the current tag. TheMap
contains pairs of attribute name and value.- Parameters:
attributes
- aMap
of attributes- Throws:
UnmodifiableException
- thrown if the current tag is read-only.- See Also:
setAttribute(String, String)
-
setCssClass
void setCssClass(java.lang.String css) throws UnmodifiableException
Sets a class name for the Cascading Style Sheets attribute on the current tag. It is equivalent to call the methodsetAttribute(
EnumHTMLTags.ATT_CLASS
, css)- Parameters:
css
- the class name of the Cascading Style Sheets attribute- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
setId
void setId(java.lang.String id) throws UnmodifiableException
Sets a value to the ID attribute on the current tag. It is equivalent to call the methodsetAttribute(
.EnumHTMLTags.ATT_ID
, id)- Parameters:
id
- the valud of the ID attribute.- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
setIsClosedRequired
void setIsClosedRequired(boolean closeReq) throws UnmodifiableException
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.
-
setIsContentInline
void setIsContentInline(boolean inline) throws UnmodifiableException
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.
-
setStyle
void setStyle(java.lang.String style) throws UnmodifiableException
Set a value to the style attribute. It is equivalent to call the methodsetAttribute(
.EnumHTMLTags.ATT_STYLE
, style)- Parameters:
style
- the style attribute value.- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
setTagName
void setTagName(java.lang.String name) throws UnmodifiableException
Sets the current tag name.- Parameters:
name
- the tag name.- Throws:
UnmodifiableException
- thrown if the current tag is read-only.
-
setSealed
void setSealed()
Marks the current tag as read-only.
-
getSealed
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.
-
getRootTag
Tag getRootTag()
Returns the root tag in the tag hierarchical tree.- Returns:
- the root tag of the tree to which the current tag belongs.
-
setRootTag
void setRootTag(Tag root) throws UnmodifiableException
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.
-
getLineNumber
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.
-
setLineNumber
void setLineNumber(int lineNumber) throws UnmodifiableException
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.
-
isDynamic
boolean isDynamic()
Returns a boolean value indicating whether the current tag is dynamic. A dynamic tag might not get its opening tag rendered when theLayoutContext
object is not null.- Returns:
true
to indicate that the current tag is dynamic.- See Also:
render(MarkupOutput, LayoutContext)
-
setDynamic
void setDynamic(boolean dyn) throws UnmodifiableException
Sets a boolean value indicating whether the current tag is dynamic. A dynamic tag might not get its opening tag rendered when theLayoutContext
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.- See Also:
render(MarkupOutput, LayoutContext)
-
getChildren
java.util.Enumeration getChildren()
Returns aEnumeration
of children of the current tag.- Returns:
- a
Enumeration
of children of the current tag.
-
getAttributeNames
java.util.Enumeration getAttributeNames()
Returns aEnumeration
of attributes of the current tag.- Returns:
- a
Enumeration
of attributes of the current tag.
-
replaceContent
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- Since:
- MicroStrategy Web 8.0.2
-
getDeepCopy
Tag getDeepCopy()
Returns a deep copy of this tag- Returns:
- Tag - This tag is a full copy of the current tag
- Since:
- MicroStrategy Web 8.0.2
-
setPreserveCase
void setPreserveCase(boolean preserveCase)
Sets the character cases when rendering the tag name and attribute name. Default isfalse
.- 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.- Since:
- MicroStrategy Web 9.0.0
-
getPreserveCase
boolean getPreserveCase()
Gets the character cases when rendering the tag name and attribute name.- Since:
- MicroStrategy Web 9.0.0
-
removeChildren
void removeChildren()
Remove any existing child tag from this tag.- Since:
- MicroStrategy Web 9.0.0
-
-