Package com.google.gwt.xml.client
Interface Node
-
- All Known Subinterfaces:
Attr,CDATASection,CharacterData,Comment,Document,DocumentFragment,Element,EntityReference,ProcessingInstruction,Text
public interface NodeThis is the base interface for DOM nodes, as obtained from usingXMLParsermethods. Methods for iterating over and accessing values from nodes are supplied here.
-
-
Field Summary
Fields Modifier and Type Field Description static shortATTRIBUTE_NODEThe constant 2 denotes DOM nodes of type Attribute.static shortCDATA_SECTION_NODEThe constant 4 denotes DOM nodes of type CdataSection.static shortCOMMENT_NODEThe constant 8 denotes DOM nodes of type Comment.static shortDOCUMENT_FRAGMENT_NODEThe constant 11 denotes DOM nodes of type DocumentFragment.static shortDOCUMENT_NODEThe constant 9 denotes DOM nodes of type Document.static shortDOCUMENT_TYPE_NODEThe constant 10 denotes DOM nodes of type DocumentType.static shortELEMENT_NODEThe constant 1 denotes DOM nodes of type Element.static shortENTITY_NODEThe constant 6 denotes DOM nodes of type Entity.static shortENTITY_REFERENCE_NODEThe constant 5 denotes DOM nodes of type EntityReference.static shortNOTATION_NODEThe constant 12 denotes DOM nodes of type Notation.static shortPROCESSING_INSTRUCTION_NODEThe constant 7 denotes DOM nodes of type ProcessingInstruction.static shortTEXT_NODEThe constant 3 denotes DOM nodes of type Text.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NodeappendChild(Node newChild)This method appends childnewChild.NodecloneNode(boolean deep)This method copies thisNode.NamedNodeMapgetAttributes()This method retrieves the attributes.NodeListgetChildNodes()This method retrieves the child nodes.NodegetFirstChild()This method retrieves the first child.NodegetLastChild()This method retrieves the last child.java.lang.StringgetNamespaceURI()This method retrieves the namespace URI.NodegetNextSibling()This method retrieves the next sibling.java.lang.StringgetNodeName()This method retrieves the name.shortgetNodeType()This method retrieves the type.java.lang.StringgetNodeValue()This method retrieves the value.DocumentgetOwnerDocument()This method retrieves the owner document.NodegetParentNode()This method retrieves the parent.java.lang.StringgetPrefix()This method retrieves the prefix.NodegetPreviousSibling()This method retrieves the previous sibling.booleanhasAttributes()This method determines whether thisNodehas any attributes.booleanhasChildNodes()This method determines whether thisNodehas any child nodes.NodeinsertBefore(Node newChild, Node refChild)This method inserts beforenewChild.voidnormalize()This method may collapse adjacent text nodes into one text node, depending on the implementation.NoderemoveChild(Node oldChild)This method removes childoldChild.NodereplaceChild(Node newChild, Node oldChild)This method replaces the childoldChildwithnewChild.voidsetNodeValue(java.lang.String nodeValue)This method sets the value tonodeValue.
-
-
-
Field Detail
-
ELEMENT_NODE
static final short ELEMENT_NODE
The constant 1 denotes DOM nodes of type Element.- See Also:
- Constant Field Values
-
ATTRIBUTE_NODE
static final short ATTRIBUTE_NODE
The constant 2 denotes DOM nodes of type Attribute.- See Also:
- Constant Field Values
-
TEXT_NODE
static final short TEXT_NODE
The constant 3 denotes DOM nodes of type Text.- See Also:
- Constant Field Values
-
CDATA_SECTION_NODE
static final short CDATA_SECTION_NODE
The constant 4 denotes DOM nodes of type CdataSection.- See Also:
- Constant Field Values
-
ENTITY_REFERENCE_NODE
static final short ENTITY_REFERENCE_NODE
The constant 5 denotes DOM nodes of type EntityReference.- See Also:
- Constant Field Values
-
ENTITY_NODE
static final short ENTITY_NODE
The constant 6 denotes DOM nodes of type Entity.- See Also:
- Constant Field Values
-
PROCESSING_INSTRUCTION_NODE
static final short PROCESSING_INSTRUCTION_NODE
The constant 7 denotes DOM nodes of type ProcessingInstruction.- See Also:
- Constant Field Values
-
COMMENT_NODE
static final short COMMENT_NODE
The constant 8 denotes DOM nodes of type Comment.- See Also:
- Constant Field Values
-
DOCUMENT_NODE
static final short DOCUMENT_NODE
The constant 9 denotes DOM nodes of type Document.- See Also:
- Constant Field Values
-
DOCUMENT_TYPE_NODE
static final short DOCUMENT_TYPE_NODE
The constant 10 denotes DOM nodes of type DocumentType.- See Also:
- Constant Field Values
-
DOCUMENT_FRAGMENT_NODE
static final short DOCUMENT_FRAGMENT_NODE
The constant 11 denotes DOM nodes of type DocumentFragment.- See Also:
- Constant Field Values
-
NOTATION_NODE
static final short NOTATION_NODE
The constant 12 denotes DOM nodes of type Notation.- See Also:
- Constant Field Values
-
-
Method Detail
-
appendChild
Node appendChild(Node newChild)
This method appends childnewChild.- Parameters:
newChild- theNodeto be added- Returns:
- the child
Nodeappended
-
cloneNode
Node cloneNode(boolean deep)
This method copies thisNode.- Parameters:
deep- whether to recurse to children- Returns:
Nodecloned
-
getAttributes
NamedNodeMap getAttributes()
This method retrieves the attributes.- Returns:
- the attributes of this
Node
-
getChildNodes
NodeList getChildNodes()
This method retrieves the child nodes.- Returns:
- the child nodes of this
Node
-
getFirstChild
Node getFirstChild()
This method retrieves the first child.- Returns:
- the first child of this
Node
-
getLastChild
Node getLastChild()
This method retrieves the last child.- Returns:
- the last child of this
Node
-
getNamespaceURI
java.lang.String getNamespaceURI()
This method retrieves the namespace URI.- Returns:
- the namespace URI of this
Node
-
getNextSibling
Node getNextSibling()
This method retrieves the next sibling.- Returns:
- the next sibling of this
Node
-
getNodeName
java.lang.String getNodeName()
This method retrieves the name.- Returns:
- the name of this
Node
-
getNodeType
short getNodeType()
This method retrieves the type.- Returns:
- the type of this
Node
-
getNodeValue
java.lang.String getNodeValue()
This method retrieves the value.- Returns:
- the value of this
Node
-
getOwnerDocument
Document getOwnerDocument()
This method retrieves the owner document.- Returns:
- the owner document of this
Node
-
getParentNode
Node getParentNode()
This method retrieves the parent.- Returns:
- the parent of this
Node
-
getPrefix
java.lang.String getPrefix()
This method retrieves the prefix.- Returns:
- the prefix of this
Node
-
getPreviousSibling
Node getPreviousSibling()
This method retrieves the previous sibling.- Returns:
- the previous sibling of this
Node
-
hasAttributes
boolean hasAttributes()
This method determines whether thisNodehas any attributes.- Returns:
trueif thisNodehas any attributes
-
hasChildNodes
boolean hasChildNodes()
This method determines whether thisNodehas any child nodes.- Returns:
trueif thisNodehas any child nodes
-
insertBefore
Node insertBefore(Node newChild, Node refChild)
This method inserts beforenewChild.- Parameters:
newChild- theNodeto be addedrefChild- theNodewhich determines the position to insert- Returns:
- the before
Nodeinserted
-
normalize
void normalize()
This method may collapse adjacent text nodes into one text node, depending on the implementation. Safari 4.0 and Chrome will also merge CDATA nodes into text nodes, even though they support CDATA nodes as distinct nodes.
-
removeChild
Node removeChild(Node oldChild)
This method removes childoldChild.- Parameters:
oldChild- theNodeto be removed- Returns:
- the child
Noderemoved
-
replaceChild
Node replaceChild(Node newChild, Node oldChild)
This method replaces the childoldChildwithnewChild.- Parameters:
newChild- theNodeto be addedoldChild- theNodeto be removed- Returns:
- the child
Nodereplaced
-
setNodeValue
void setNodeValue(java.lang.String nodeValue)
This method sets the value tonodeValue.- Parameters:
nodeValue- the new value
-
-