public class WikiTagNode extends AbstractNode
| Modifier and Type | Field and Description |
|---|---|
protected List<NodeAttribute> |
mAttributes
The tag attributes.
|
nodeBegin, nodeEnd| Constructor and Description |
|---|
WikiTagNode()
Create an empty tag.
|
WikiTagNode(int start,
int end,
ArrayList<NodeAttribute> attributes)
Create a tag with the location and attributes provided
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAttribute(String name)
Returns the value of an attribute.
|
NodeAttribute |
getAttributeEx(String name)
Returns the attribute with the given name.
|
List<NodeAttribute> |
getAttributesEx()
Gets the attributes in the tag.
|
String[] |
getEnders()
Return the set of tag names that cause this tag to finish.
|
String[] |
getEndTagEnders()
Return the set of end tag names that cause this tag to finish.
|
String[] |
getIds()
Return the set of names handled by this tag.
|
String |
getRawTagName()
Return the name of this tag.
|
int |
getTagBegin()
Gets the nodeBegin.
|
int |
getTagEnd()
Gets the nodeEnd.
|
String |
getTagName()
Return the name of this tag.
|
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(String key)
Remove the attribute with the given key, if it exists.
|
void |
setAttribute(NodeAttribute attribute)
Set an attribute.
|
void |
setAttribute(String key,
String value)
Set attribute with given key, value pair.
|
void |
setAttribute(String key,
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(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(String name)
Set the name of this tag.
|
String |
toHtml(boolean verbatim)
Render the tag as HTML.
|
String |
toPlainTextString()
Get the plain text from this node.
|
clone, getEndPosition, getStartPosition, setEndPosition, setStartPosition, setText, toHtmlprotected List<NodeAttribute> mAttributes
Attribute. The first element is
the tag name, subsequent elements being either whitespace or real
attributes.public WikiTagNode()
public WikiTagNode(int start,
int end,
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.Attributepublic String getAttribute(String name)
name - Name of attribute, case insensitive.public void setAttribute(String key, String value)
key - The name of the attribute.value - The value of the attribute.public void removeAttribute(String key)
key - The name of the attribute.public void setAttribute(String key, 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(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 List<NodeAttribute> getAttributesEx()
Attributes in the tag. The
first element is the tag name, subsequent elements being either
whitespace or real attributes.public 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 String getRawTagName()
public void setTagName(String name)
name - The tag name.public String getText()
getText in class AbstractNodepublic void setAttributesEx(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 String toPlainTextString()
toPlainTextString in class AbstractNodetoHtml().public 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 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 String[] getIds()
public String[] getEnders()
public String[] getEndTagEnders()
Copyright © 2017 Java Wikipedia API (Bliki engine). All rights reserved.