public abstract class DOMNode extends Object implements Node, DOMRange
Modifier and Type | Field and Description |
---|---|
static short |
DTD_ATT_LIST_NODE
The node is a
DTD Attribute List . |
static short |
DTD_DECL_NODE
The node is a generic
DTD Decl Node . |
static short |
DTD_ELEMENT_DECL_NODE
The node is a
DTD Element Declaration . |
static short |
DTD_ENTITY_DECL_NODE
The node is a
DTD Entity Declaraction . |
static short |
DTD_NOTATION_DECL
The node is a
DTD Notation Declaraction . |
static int |
NULL_VALUE
Null value used for offset.
|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
DOMNode(int start,
int end) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(DOMNode child)
Add node child and set child.parent to
this |
Node |
appendChild(Node newChild) |
Node |
cloneNode(boolean deep) |
short |
compareDocumentPosition(Node other) |
static DOMAttr |
findAttrAt(DOMNode node,
int offset) |
DOMAttr |
findAttrAt(int offset) |
DOMNode |
findNodeAt(int offset) |
DOMNode |
findNodeBefore(int offset)
Returns the node before
|
static DOMNode |
findNodeOrAttrAt(DOMDocument document,
int offset) |
String |
getAttribute(String name) |
DOMAttr |
getAttributeAtIndex(int index)
Returns the attribute at the given index, the order is how the attributes
appear in the document.
|
DOMAttr |
getAttributeNode(String name) |
DOMAttr |
getAttributeNode(String prefix,
String suffix)
Returns the attribute that matches the given name.
|
List<DOMAttr> |
getAttributeNodes() |
NamedNodeMap |
getAttributes() |
String |
getBaseURI() |
DOMNode |
getChild(int index)
Returns node child at the given index.
|
NodeList |
getChildNodes() |
List<DOMNode> |
getChildren()
Returns the node children.
|
List<DOMNode> |
getChildrenWithAttributeValue(String name,
String value)
Returns a list of children, each having an attribute called name, with a
value of value
|
int |
getEnd()
Returns the end offset of the node.
|
Object |
getFeature(String arg0,
String arg1) |
DOMNode |
getFirstChild() |
DOMNode |
getLastChild() |
String |
getLocalName() |
String |
getNamespaceURI() |
DOMNode |
getNextSibling() |
String |
getNodeValue() |
DOMElement |
getOrphanEndElement(int offset,
String tagName)
Returns the orphan end element after the given offset which matches the given
tagName and null otherwise.
|
DOMElement |
getOrphanEndElement(int offset,
String tagName,
boolean anyOrphan)
Returns the orphan end element after the given offset which matches the given
tagName and the first orphan end element otherwise and null otherwise.
|
DOMDocument |
getOwnerDocument()
Returns the owner document and null otherwise.
|
DOMElement |
getParentElement() |
DOMNode |
getParentNode() |
String |
getPrefix() |
DOMNode |
getPreviousNonTextSibling() |
DOMNode |
getPreviousSibling() |
int |
getStart()
Returns the start offset of the node.
|
String |
getTextContent() |
Object |
getUserData(String arg0) |
boolean |
hasAttribute(String name) |
boolean |
hasAttributes() |
boolean |
hasChildNodes() |
Node |
insertBefore(Node arg0,
Node arg1) |
boolean |
isAttribute() |
boolean |
isCDATA() |
boolean |
isCharacterData() |
boolean |
isChildOfOwnerDocument() |
boolean |
isClosed() |
boolean |
isComment() |
boolean |
isDefaultNamespace(String arg0) |
boolean |
isDoctype() |
boolean |
isDTDAttListDecl() |
boolean |
isDTDElementDecl() |
boolean |
isDTDEntityDecl() |
boolean |
isDTDNotationDecl() |
boolean |
isElement() |
boolean |
isEqualNode(Node arg0) |
boolean |
isGenericDTDDecl() |
static boolean |
isIncluded(DOMRange node,
int offset)
Returns true if the node included the given offset and false otherwise.
|
static boolean |
isIncluded(int start,
int end,
int offset) |
boolean |
isOwnerDocument() |
boolean |
isProcessingInstruction() |
boolean |
isProlog() |
boolean |
isSameNode(Node arg0) |
boolean |
isSupported(String arg0,
String arg1) |
boolean |
isText() |
String |
lookupNamespaceURI(String arg0) |
String |
lookupPrefix(String arg0) |
void |
normalize() |
Node |
removeChild(Node arg0) |
Node |
replaceChild(Node arg0,
Node arg1) |
void |
setAttribute(String name,
String value) |
void |
setAttributeNode(DOMAttr attr) |
void |
setNodeValue(String arg0) |
void |
setPrefix(String arg0) |
void |
setTextContent(String arg0) |
Object |
setUserData(String arg0,
Object arg1,
UserDataHandler arg2) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNodeName, getNodeType
public static final int NULL_VALUE
public static final short DTD_ELEMENT_DECL_NODE
DTD Element Declaration
.public static final short DTD_ATT_LIST_NODE
DTD Attribute List
.public static final short DTD_ENTITY_DECL_NODE
DTD Entity Declaraction
.public static final short DTD_NOTATION_DECL
DTD Notation Declaraction
.public static final short DTD_DECL_NODE
DTD Decl Node
.public DOMDocument getOwnerDocument()
getOwnerDocument
in interface DOMRange
getOwnerDocument
in interface Node
public DOMNode findNodeBefore(int offset)
public DOMNode findNodeAt(int offset)
public static boolean isIncluded(DOMRange node, int offset)
node
- offset
- public static boolean isIncluded(int start, int end, int offset)
public DOMAttr findAttrAt(int offset)
public static DOMNode findNodeOrAttrAt(DOMDocument document, int offset)
public DOMAttr getAttributeNode(String prefix, String suffix)
public DOMAttr getAttributeAtIndex(int index)
index
- Starting at 0, index of attribute you wantpublic boolean hasAttribute(String name)
public boolean hasAttributes()
hasAttributes
in interface Node
public void setAttributeNode(DOMAttr attr)
public List<DOMNode> getChildrenWithAttributeValue(String name, String value)
name
- name of attributevalue
- value of attributepublic List<DOMNode> getChildren()
public void addChild(DOMNode child)
this
child
- the node child to add.public DOMNode getChild(int index)
index
- public boolean isClosed()
public DOMElement getParentElement()
public boolean isComment()
public boolean isProcessingInstruction()
public boolean isProlog()
public boolean isCDATA()
public boolean isDoctype()
public boolean isGenericDTDDecl()
public boolean isElement()
public boolean isAttribute()
public boolean isText()
public boolean isCharacterData()
public boolean isDTDElementDecl()
public boolean isDTDAttListDecl()
public boolean isDTDEntityDecl()
public boolean isDTDNotationDecl()
public boolean isOwnerDocument()
public boolean isChildOfOwnerDocument()
public int getStart()
DOMRange
public int getEnd()
DOMRange
public String getLocalName()
getLocalName
in interface Node
public DOMNode getParentNode()
getParentNode
in interface Node
public DOMNode getFirstChild()
getFirstChild
in interface Node
public DOMNode getLastChild()
getLastChild
in interface Node
public NamedNodeMap getAttributes()
getAttributes
in interface Node
public NodeList getChildNodes()
getChildNodes
in interface Node
public Node appendChild(Node newChild) throws DOMException
appendChild
in interface Node
DOMException
public short compareDocumentPosition(Node other) throws DOMException
compareDocumentPosition
in interface Node
DOMException
public String getBaseURI()
getBaseURI
in interface Node
public Object getFeature(String arg0, String arg1)
getFeature
in interface Node
public String getNamespaceURI()
getNamespaceURI
in interface Node
public DOMNode getNextSibling()
getNextSibling
in interface Node
public String getNodeValue() throws DOMException
getNodeValue
in interface Node
DOMException
public DOMNode getPreviousSibling()
getPreviousSibling
in interface Node
public DOMNode getPreviousNonTextSibling()
public DOMElement getOrphanEndElement(int offset, String tagName)
| <\foo>
offset
- the offset.tagName
- the tag name.public DOMElement getOrphanEndElement(int offset, String tagName, boolean anyOrphan)
| <\foo>
offset
- the offset.tagName
- the tag name.anyOrphan
- true if any orphan should be returned and false otherwise.public String getTextContent() throws DOMException
getTextContent
in interface Node
DOMException
public Object getUserData(String arg0)
getUserData
in interface Node
public boolean hasChildNodes()
hasChildNodes
in interface Node
public Node insertBefore(Node arg0, Node arg1) throws DOMException
insertBefore
in interface Node
DOMException
public boolean isDefaultNamespace(String arg0)
isDefaultNamespace
in interface Node
public boolean isEqualNode(Node arg0)
isEqualNode
in interface Node
public boolean isSameNode(Node arg0)
isSameNode
in interface Node
public boolean isSupported(String arg0, String arg1)
isSupported
in interface Node
public String lookupNamespaceURI(String arg0)
lookupNamespaceURI
in interface Node
public String lookupPrefix(String arg0)
lookupPrefix
in interface Node
public Node removeChild(Node arg0) throws DOMException
removeChild
in interface Node
DOMException
public Node replaceChild(Node arg0, Node arg1) throws DOMException
replaceChild
in interface Node
DOMException
public void setNodeValue(String arg0) throws DOMException
setNodeValue
in interface Node
DOMException
public void setPrefix(String arg0) throws DOMException
setPrefix
in interface Node
DOMException
public void setTextContent(String arg0) throws DOMException
setTextContent
in interface Node
DOMException
public Object setUserData(String arg0, Object arg1, UserDataHandler arg2)
setUserData
in interface Node
Copyright © 2022. All rights reserved.