public class Comment extends LeafNode
EmptyNodes, EmptyString, parentNode, siblingIndex| Constructor and Description |
|---|
Comment(java.lang.String data)
Create a new comment node.
|
| Modifier and Type | Method and Description |
|---|---|
XmlDeclaration |
asXmlDeclaration()
Attempt to cast this comment to an XML Declaration node.
|
Comment |
clone()
Create a stand-alone, deep copy of this node, and all of its children.
|
java.lang.String |
getData()
Get the contents of the comment.
|
boolean |
isXmlDeclaration()
Check if this comment looks like an XML Declaration.
|
private static boolean |
isXmlDeclarationData(java.lang.String data) |
java.lang.String |
nodeName()
Get the node name of this node.
|
(package private) void |
outerHtmlHead(java.lang.Appendable accum,
int depth,
Document.OutputSettings out)
Get the outer HTML of this node.
|
(package private) void |
outerHtmlTail(java.lang.Appendable accum,
int depth,
Document.OutputSettings out) |
Comment |
setData(java.lang.String data) |
java.lang.String |
toString()
Gets this node's outer HTML.
|
absUrl, attr, attr, attributes, baseUri, childNodeSize, coreValue, coreValue, doClone, doSetBaseUri, empty, ensureChildNodes, hasAttr, hasAttributes, removeAttraddChildren, addChildren, after, after, attributesSize, before, before, childNode, childNodes, childNodesAsArray, childNodesCopy, clearAttributes, equals, filter, firstChild, forEachNode, forEachNode, hashCode, hasParent, hasSameValue, html, indent, isEffectivelyFirst, isNode, isNode, lastChild, nextSibling, nodelistChanged, normalName, outerHtml, outerHtml, ownerDocument, parent, parentNode, previousSibling, remove, removeChild, reparentChild, replaceChild, replaceWith, root, setBaseUri, setParentNode, setSiblingIndex, shallowClone, siblingIndex, siblingNodes, sourceRange, traverse, unwrap, wrappublic Comment(java.lang.String data)
data - The contents of the commentpublic java.lang.String nodeName()
Nodepublic java.lang.String getData()
public Comment setData(java.lang.String data)
void outerHtmlHead(java.lang.Appendable accum,
int depth,
Document.OutputSettings out)
throws java.io.IOException
NodeouterHtmlHead in class Nodeaccum - accumulator to place HTML intojava.io.IOException - if appending to the given accumulator fails.void outerHtmlTail(java.lang.Appendable accum,
int depth,
Document.OutputSettings out)
outerHtmlTail in class Nodepublic java.lang.String toString()
NodetoString in class NodeNode.outerHtml()public Comment clone()
Node
The cloned node may be adopted into another Document or node structure using Element.appendChild(Node).
clone in class NodeNode.shallowClone()public boolean isXmlDeclaration()
private static boolean isXmlDeclarationData(java.lang.String data)
@Nullable public XmlDeclaration asXmlDeclaration()