|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.bliki.wiki.tags.util.AbstractNode
info.bliki.wiki.tags.util.WikiTagNode
public class WikiTagNode
TagNode represents a generic tag. If no scanner is registered for a given tag name, this is what you get. This is also the base class for all tags created by the parser.
| Constructor Summary | |
|---|---|
WikiTagNode()
Create an empty tag. |
|
WikiTagNode(int start,
int end,
java.util.ArrayList<NodeAttribute> attributes)
Create a tag with the location and attributes provided |
|
| Method Summary | |
|---|---|
boolean |
breaksFlow()
Determines if the given tag breaks the flow of text. |
java.lang.String |
getAttribute(java.lang.String name)
Returns the value of an attribute. |
NodeAttribute |
getAttributeEx(java.lang.String name)
Returns the attribute with the given name. |
java.util.List<NodeAttribute> |
getAttributesEx()
Gets the attributes in the tag. |
java.lang.String[] |
getEnders()
Return the set of tag names that cause this tag to finish. |
java.lang.String[] |
getEndTagEnders()
Return the set of end tag names that cause this tag to finish. |
java.lang.String[] |
getIds()
Return the set of names handled by this tag. |
java.lang.String |
getRawTagName()
Return the name of this tag. |
int |
getTagBegin()
Gets the nodeBegin. |
int |
getTagEnd()
Gets the nodeEnd. |
java.lang.String |
getTagName()
Return the name of this tag. |
java.lang.String |
getText()
Return the text contained in this tag. |
boolean |
isEmptyXmlTag()
Is this an empty xml tag of the form <tag/>. |
boolean |
isEndTag()
Predicate to determine if this tag is an end tag (i.e. |
void |
removeAttribute(java.lang.String key)
Remove the attribute with the given key, if it exists. |
void |
setAttribute(NodeAttribute attribute)
Set an attribute. |
void |
setAttribute(java.lang.String key,
java.lang.String value)
Set attribute with given key, value pair. |
void |
setAttribute(java.lang.String key,
java.lang.String value,
char quote)
Set attribute with given key, value pair where the value is quoted by quote. |
void |
setAttributeEx(NodeAttribute attribute)
Set an attribute. |
void |
setAttributesEx(java.util.List<NodeAttribute> attribs)
Sets the attributes. |
void |
setEmptyXmlTag(boolean emptyXmlTag)
Set this tag to be an empty xml node, or not. |
void |
setTagBegin(int tagBegin)
Sets the nodeBegin. |
void |
setTagEnd(int tagEnd)
Sets the nodeEnd. |
void |
setTagName(java.lang.String name)
Set the name of this tag. |
java.lang.String |
toHtml(boolean verbatim)
Render the tag as HTML. |
java.lang.String |
toPlainTextString()
Get the plain text from this node. |
| Methods inherited from class info.bliki.wiki.tags.util.AbstractNode |
|---|
clone, getEndPosition, getStartPosition, setEndPosition, setStartPosition, setText, toHtml |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WikiTagNode()
public WikiTagNode(int start,
int end,
java.util.ArrayList<NodeAttribute> attributes)
page - The page this tag was read from.start - The starting offset of this node within the page.end - The ending offset of this node within the page.attributes - The list of attributes that were parsed in this tag.Attribute| Method Detail |
|---|
public java.lang.String getAttribute(java.lang.String name)
name - Name of attribute, case insensitive.
public void setAttribute(java.lang.String key,
java.lang.String value)
key - The name of the attribute.value - The value of the attribute.public void removeAttribute(java.lang.String key)
key - The name of the attribute.
public void setAttribute(java.lang.String key,
java.lang.String value,
char quote)
key - The name of the attribute.value - The value of the attribute.quote - The quote character to be used around value. If zero, it is an
unquoted value.public NodeAttribute getAttributeEx(java.lang.String name)
name - Name of attribute, case insensitive.
public void setAttributeEx(NodeAttribute attribute)
attribute - The attribute to set.#setAttribute(Attribute)public void setAttribute(NodeAttribute attribute)
attribute - The attribute to set.public java.util.List<NodeAttribute> getAttributesEx()
Attributes in the tag. The
first element is the tag name, subsequent elements being either
whitespace or real attributes.public java.lang.String getTagName()
Note: This value is converted to uppercase and does not
begin with "/" if it is an end tag. Nor does it end with
a slash in the case of an XML type tag.
To get at the original text of the tag name use
getRawTagName().
The conversion to uppercase is performed with an ENGLISH locale.
public java.lang.String getRawTagName()
public void setTagName(java.lang.String name)
name - The tag name.public java.lang.String getText()
getText in class AbstractNodepublic void setAttributesEx(java.util.List<NodeAttribute> attribs)
attribs - The attribute collection to set.public void setTagBegin(int tagBegin)
tagBegin - The nodeBegin to setpublic int getTagBegin()
public void setTagEnd(int tagEnd)
tagEnd - The nodeEnd to setpublic int getTagEnd()
public java.lang.String toPlainTextString()
toPlainTextString in class AbstractNodetoHtml().public java.lang.String toHtml(boolean verbatim)
toHtml() method
will render it in HTML.
toHtml in class AbstractNodeverbatim - If true return as close to the original page
text as possible.
org.htmlparser.Node#toHtml()public boolean breaksFlow()
true if following text would start on a new line,
false otherwise.public boolean isEmptyXmlTag()
public void setEmptyXmlTag(boolean emptyXmlTag)
emptyXmlTag - If true, ensures there is an ending slash in the node, i.e.
<tag/>, otherwise removes it.public boolean isEndTag()
true if this tag is an end tag.public java.lang.String[] getIds()
public java.lang.String[] getEnders()
public java.lang.String[] getEndTagEnders()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||