Java org.dom4j Node fields, constructors, methods, implement or subclass

Example usage for Java org.dom4j Node fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.dom4j Node.

The text is from its open source code.

Subclass

org.dom4j.Node has subclasses.
Click this link to see all its subclasses.

Field

shortELEMENT_NODE
Matches Element nodes
shortATTRIBUTE_NODE
Matches elements nodes
shortTEXT_NODE
Matches elements nodes
shortCDATA_SECTION_NODE
Matches elements nodes
shortENTITY_REFERENCE_NODE
Matches elements nodes
shortPROCESSING_INSTRUCTION_NODE
Matches ProcessingInstruction
shortCOMMENT_NODE
Matches Comments nodes
shortDOCUMENT_NODE
Matches Document nodes
shortDOCUMENT_TYPE_NODE
Matches DocumentType nodes
shortNAMESPACE_NODE
Matchs a Namespace Node - NOTE this differs from DOM

Method

voidaccept(Visitor visitor)

accept is the method used in the Visitor Pattern.

StringasXML()

asXML returns the textual XML representation of this node.

Objectclone()

clone will return a deep clone or if this node is read-only then clone will return the same instance.

XPathcreateXPath(String xpathExpression)

createXPath creates an XPath object for the given xpathExpression.

Nodedetach()

Removes this node from its parent if there is one.

DocumentgetDocument()

getDocument returns the Document that this Node is part of if this node supports the parent relationship.

StringgetName()

getName returns the name of this node.

shortgetNodeType()
Returns the code according to the type of node.
StringgetNodeTypeName()
DOCUMENT ME!
ElementgetParent()

getParent returns the parent Element if this node supports the parent relationship or null if it is the root element or does not support the parent relationship.

StringgetPath()

Returns the XPath expression which will return a node set containing the given node such as /a/b/@c.

StringgetStringValue()
Returns the XPath string-value of this node.
StringgetText()

Returns the text of this node.

StringgetUniquePath()

Returns the XPath expression which will return a nodeset of one node which is the current node.

booleanhasContent()

hasContent returns true if this node is a Branch (either an Element or a Document) and it contains at least one content node such as a child Element or Text node.

booleanisReadOnly()

isReadOnly returns true if this node is read only and cannot be modified.

booleanmatches(String xpathExpression)

matches returns true if evaluating the given XPath expression on this node returns a non-empty node set containing this node.

NumbernumberValueOf(String xpathExpression)

numberValueOf evaluates an XPath expression and returns the numeric value of the XPath expression if the XPath expression results in a number, or null if the result is not a number.

ListselectNodes(String xpathExpression)

selectNodes evaluates an XPath expression and returns the result as a List of Node instances or String instances depending on the XPath expression.

ListselectNodes(String xpathExpression, String comparisonXPathExpression)

selectNodes evaluates an XPath expression then sorts the results using a secondary XPath expression Returns a sorted List of Node instances.

ObjectselectObject(String xpathExpression)

selectObject evaluates an XPath expression and returns the result as an Object .

NodeselectSingleNode(String xpathExpression)

selectSingleNode evaluates an XPath expression and returns the result as a single Node instance.

voidsetName(String name)

Sets the text data of this node or this method will throw an UnsupportedOperationException if it is read-only.

voidsetParent(Element parent)

setParent sets the parent relationship of this node if the parent relationship is supported or does nothing if the parent relationship is not supported.

voidsetText(String text)

Sets the text data of this node or this method will throw an UnsupportedOperationException if it is read-only.

StringvalueOf(String xpathExpression)

valueOf evaluates an XPath expression and returns the textual representation of the results the XPath string-value of this node.

voidwrite(Writer writer)

write writes this node as the default XML notation for this node.