|
Oracle® Application Server XML Java API Reference 10g Release 3 (10.1.3) B28238-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.xml.parser.v2.XMLNode
Implements the DOM Node
interface and serves as the primary datatype for the entire Document Object Model. It represents a single node in the document tree.
The attributes nodeName
, nodeValue
and attributes
are included as a mechanism to get at node information without casting down to the specific derived instance. In cases where there is no obvious mapping of these attributes for a specific nodeType
(e.g., nodeValue
for an Element or attributes
for a Comment), this returns null
. Note that the derived classes may contain additional and more convenient mechanisms to get and set the relevant information.
Field Summary | |
static short |
ATTRDECL A attribute declaration node |
static java.lang.String |
Auto_Events Flag to set Auto EVENTS |
static java.lang.String |
capturing |
static java.lang.String |
DOMAttrModified |
static java.lang.String |
DOMCharacterDataModified |
static java.lang.String |
DOMNodeInserted |
static java.lang.String |
DOMNodeInsertedIntoDocument |
static java.lang.String |
DOMNodeRemoved |
static java.lang.String |
DOMNodeRemovedFromDocument |
static java.lang.String |
DOMSubtreeModified |
static short |
ELEMENTDECL An element declaration node. |
static short |
NAMESPACE_NODE A namespace node |
static java.lang.String |
noncapturing |
static java.lang.String |
RANGE_DELETE_EVENT Flag to delete range event |
static java.lang.String |
RANGE_DELETETEXT_EVENT Flag to set range delete text event |
static java.lang.String |
RANGE_INSERT_EVENT Flag to set range event |
static java.lang.String |
RANGE_INSERTTEXT_EVENT Flag to set range insert text event |
static java.lang.String |
RANGE_REPLACE_EVENT Flag to replace range event |
static java.lang.String |
RANGE_SETTEXT_EVENT Flag to set range text event |
static java.lang.String |
TRAVERSAL_DELETE_EVENT Flag to set traversal delete event |
static java.lang.String |
TRAVERSAL_REPLACE_EVENT Flag to set traversal replace event |
static int |
XDB_DATA |
static short |
XMLDECL_NODE A attribute declaration node |
Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Fields inherited from interface org.w3c.dom.validation.NodeEditVAL |
VAL_FALSE, VAL_INCOMPLETE, VAL_NS_WF, VAL_SCHEMA, VAL_TRUE, VAL_UNKNOWN, VAL_WF |
Constructor Summary | |
protected |
XMLNode() Constructs a new XMLNode |
Method Summary | |
void |
addEventListener(java.lang.String type, EventListener listener, boolean useCapture) This method allows the registration of event listeners on the event target |
void |
addText(char[] ch, int start, int length) Adds text to this node, or appends str to the last child if the last child is a text node. |
Node |
appendChild(Node newChild) Adds the node newChild to the end of the list of children of this node. |
short |
canAppendChild(Node newChild) Determines whether the Node.appendChild operation would make this document not compliant with the VAL_INCOMPLETE validity type. |
short |
canInsertBefore(Node newChild, Node refChild) Determines whether the Node.insertBefore operation would make this document not compliant with the VAL_INCOMPLETE validity type. |
short |
canRemoveChild(Node oldChild) Determines whether the Node.removeChild operation would make this document not compliant with the VAL_INCOMPLETE validity type. |
short |
canReplaceChild(Node newChild, Node oldChild) Determines whether the Node.replaceChild operation would make this document not compliant with the VAL_INCOMPLETE validity type. |
Node |
cloneNode(boolean deep) Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
boolean |
dispatchEvent(Event evtArg) This method allows the dispatch of events into the implementations event model |
boolean |
equals(java.lang.Object obj) Indicates whether some other object is "equal to" this one. |
NamedNodeMap |
getAttributes() Gets a NamedNodeMap containing the attributes of this node (if it is an Element ) or null otherwise. |
NodeList |
getChildNodes() Gets a NodeList that contains all children of this node. |
int |
getColumnNumber() Get column number debug information |
boolean |
getDebugMode() Get debug information mode |
java.lang.String |
getDefaultValue() The default value specified in an attribute or an element declaration or null if unspecified. |
DOMStringList |
getEnumeratedValues() A DOMStringList , as described in [ DOM Level 3 Core] , of distinct values for an attribute or an element declaration or null if unspecified. |
Node |
getFirstChild() Gets the first child of this node. |
Node |
getLastChild() Gets the last child of this node. |
int |
getLineNumber() Get line number debug information |
java.lang.String |
getLocalName() Gets the Local Name of this node |
java.lang.String |
getNamespaceURI() Gets the namespace URI of this node. |
Node |
getNextSibling() Gets The node immediately following this node. |
java.lang.String |
getNodeName() Gets the name of this node |
short |
getNodeType() Gets the type of the node |
java.lang.String |
getNodeValue() Gets the value of this node, depending on its type |
Document |
getOwnerDocument() Gets the Document object associated with this node. |
Node |
getParentNode() Gets the parent of this node. |
java.lang.String |
getPrefix() Get the namespace prefix for this element. |
Node |
getPreviousSibling() Gets the node immediately preceding this node. |
int |
getPrimitiveTypeId() Get Schema primitive type id |
java.lang.Object |
getProperty(java.lang.String propName) Get a property of the node |
QxName |
getQName() Gets the QName of this node |
javax.xml.namespace.QName |
getSchemaTypeName() Gets the name of this node's schema type |
java.lang.String |
getSystemId() Get the system id of the entity contain this node |
java.lang.String |
getText() Returns the non-marked-up text contained by this element. |
XMLError |
getXMLError() Gets XMLError set in the document node |
boolean |
hasAttributes() Returns whether this node (if it is an element) has any attributes. |
boolean |
hasChildNodes() This is a convenience method to allow easy determination of whether a node has any children. |
int |
hashCode() Returns a hash code value for the object. |
Node |
insertBefore(Node newChild, Node refChild) Inserts the node newChild before the existing child node refChild . |
boolean |
isDocumentFlag(int flag) Returns the document flag information |
boolean |
isNodeFlag(int flag) Returns the node flag information |
boolean |
isSupported(java.lang.String feature, java.lang.String version) Tests whether the DOM implementation implements a specific feature and that feature is supported by this node. |
short |
nodeValidity(short wFValidityCheckLevel) Determines if the node is valid relative to the validation type specified in valType . |
void |
normalize() Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes,i.e., there are neither adjacent Text nodes nor empty Text nodes. |
void |
print(java.io.OutputStream out) Writes the contents of this node to the given output stream. |
void |
print(java.io.OutputStream out, java.lang.String enc) Writes the contents of this node to the given output stream. |
void |
print(java.io.PrintWriter out) Writes the contents of this node using the given print writer. |
void |
print(java.io.Writer out) Writes the contents of this node using the given print writer. |
void |
readExternal(java.io.ObjectInput inArg) This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly. |
Node |
removeChild(Node oldChild) Removes the child node indicated by oldChild from the list of children, and returns it. |
void |
removeEventListener(java.lang.String type, EventListener listener, boolean useCapture) This method allows the removal of event listeners from the event target. |
Node |
replaceChild(Node newChild, Node oldChild) Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. |
void |
reportSAXEvents(ContentHandler cntHandler) Report SAX Events from a DOM Tree |
void |
resetNodeFlag(int flag) Resets the node flag information |
NodeList |
selectNodes(java.lang.String pattern) Selects nodes from the tree which match the given pattern. |
NodeList |
selectNodes(java.lang.String pattern, NSResolver nsr) Selects nodes from the tree which match the given pattern |
Node |
selectSingleNode(java.lang.String pattern) Selects the first node from the tree that matches the given pattern |
Node |
selectSingleNode(java.lang.String pattern, NSResolver nsr) Selects the first node from the tree that matches the given pattern |
void |
setDebugInfo(int line, int col, java.lang.String sysid) Set debug information in the node |
void |
setNodeFlag(int flag) Sets the node flag information |
void |
setNodeFlag(int flag, boolean val) Sets or resets the node flag information |
void |
setNodeFlag(int flag, int mask) Sets the node multi bit flag information |
void |
setNodeValue(java.lang.String nodeValue) Sets the value of this node, depending on its type |
void |
setPrefix(java.lang.String prefix) Sets the prefix of this node |
void |
setProperty(java.lang.String propName, java.lang.Object propValue) Set a property of the node |
DocumentFragment |
transformNode(XSLStylesheet xsl) Transforms a node in the tree using the given stylesheet |
java.lang.String |
valueOf(java.lang.String pattern) Selects the value of the first node from tree that matches the pattern |
java.lang.String |
valueOf(java.lang.String pattern, NSResolver nsr) Selects the value of the first node from tree that matches the pattern |
void |
writeExternal(java.io.ObjectOutput out) This method saves the state of the object by creating a binary compressed stream with information about this object. |
long |
xdbGetNodeId() |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final short ELEMENTDECL
public static final short ATTRDECL
public static final short XMLDECL_NODE
public static final short NAMESPACE_NODE
public static final int XDB_DATA
public static final java.lang.String Auto_Events
public static final java.lang.String RANGE_SETTEXT_EVENT
public static final java.lang.String RANGE_INSERTTEXT_EVENT
public static final java.lang.String RANGE_DELETETEXT_EVENT
public static final java.lang.String RANGE_INSERT_EVENT
public static final java.lang.String RANGE_DELETE_EVENT
public static final java.lang.String RANGE_REPLACE_EVENT
public static final java.lang.String TRAVERSAL_DELETE_EVENT
public static final java.lang.String TRAVERSAL_REPLACE_EVENT
public static final java.lang.String DOMSubtreeModified
public static final java.lang.String DOMNodeInserted
public static final java.lang.String DOMNodeRemoved
public static final java.lang.String DOMNodeRemovedFromDocument
public static final java.lang.String DOMNodeInsertedIntoDocument
public static final java.lang.String DOMAttrModified
public static final java.lang.String DOMCharacterDataModified
public static final java.lang.String capturing
public static final java.lang.String noncapturing
Constructor Detail |
protected XMLNode()
XMLNode
Method Detail |
public short getNodeType()
getNodeType
in interface Node
public javax.xml.namespace.QName getSchemaTypeName()
public java.lang.String getNodeName()
getNodeName
in interface Node
public QxName getQName()
public java.lang.String getLocalName()
getLocalName
in interface Node
public java.lang.String getNamespaceURI()
getNamespaceURI
in interface Node
public java.lang.String getPrefix()
getPrefix
in interface Node
public void setPrefix(java.lang.String prefix) throws DOMException
setPrefix
in interface Node
prefix
- set the prefixDOMException
public java.lang.String getNodeValue() throws DOMException
getNodeValue
in interface Node
DOMException
public void setNodeValue(java.lang.String nodeValue) throws DOMException
setNodeValue
in interface Node
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.public Node getParentNode()
Document
, DocumentFragment
, and Attr
may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null
.getParentNode
in interface Node
public NodeList getChildNodes()
NodeList
that contains all children of this node. If there are no children, this is a NodeList
containing no nodes. The content of the returned NodeList
is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList
accessors; it is not a static snapshot of the content of the node. This is true for every NodeList
, including the ones returned by the getElementsByTagName
method.getChildNodes
in interface Node
public Node getFirstChild()
null
.getFirstChild
in interface Node
public Node getLastChild()
null
.getLastChild
in interface Node
public Node getPreviousSibling()
null
.getPreviousSibling
in interface Node
public Node getNextSibling()
null
.getNextSibling
in interface Node
public NamedNodeMap getAttributes()
NamedNodeMap
containing the attributes of this node (if it is an Element
) or null
otherwise.getAttributes
in interface Node
public Document getOwnerDocument()
Document
object associated with this node. This is also the Document
object used to create new nodes. When this node is a Document
this is null
.getOwnerDocument
in interface Node
public boolean hasAttributes()
hasAttributes
in interface Node
true
if this node has any attributes, false
otherwise.public boolean hasChildNodes()
hasChildNodes
in interface Node
true
if the node has any children, false
if the node has no children.public boolean isSupported(java.lang.String feature, java.lang.String version)
isSupported
in interface Node
public Node appendChild(Node newChild) throws DOMException
newChild
to the end of the list of children of this node. If the newChild
is already in the tree, it is first removed.appendChild
in interface Node
newChild
- The node to add.If it is a DocumentFragment
object, the entire contents of the document fragment are moved into the child list of this nodeDOMException
- HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild
node, or if the node to append is one of this node's ancestors.newChild
was created from a different document than the one that created this node.public Node removeChild(Node oldChild) throws DOMException
oldChild
from the list of children, and returns it.removeChild
in interface Node
oldChild
- The node being removed.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.oldChild
is not a child of this node.public Node insertBefore(Node newChild, Node refChild) throws DOMException
newChild
before the existing child node refChild
. If refChild
is null
, insert newChild
at the end of the list of children.newChild
is a DocumentFragment
object, all of its children are inserted, in the same order, before refChild
. If the newChild
is already in the tree, it is first removed.insertBefore
in interface Node
newChild
- The node to insert.refChild
- The reference node, i.e., the node before which the new node must be inserted.DOMException
- HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild
node, or if the node to insert is one of this node's ancestors.newChild
was created from a different document than the one that created this node.refChild
is not a child of this node.public Node replaceChild(Node newChild, Node oldChild) throws DOMException
oldChild
with newChild
in the list of children, and returns the oldChild
node. If the newChild
is already in the tree, it is first removed.replaceChild
in interface Node
newChild
- The new node to put in the child list.oldChild
- The node being replaced in the list.DOMException
- HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild
node, or it the node to put in is one of this node's ancestors.newChild
was created from a different document than the one that created this node.oldChild
is not a child of this node.public Node cloneNode(boolean deep)
parentNode
returns null
.).Element
copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text
node. Cloning any other type of node simply returns a copy of this node.cloneNode
in interface Node
deep
- If true
, recursively clone the subtree under the specified node; if false
, clone only the node itself (and its attributes, if it is an Element
).public void normalize()
normalize
in interface Node
public void addEventListener(java.lang.String type, EventListener listener, boolean useCapture)
addEventListener
in interface EventTarget
type
- the type of event for which the event listener wants to registerlistener
- the listener to be registereduseCapture
- flag to indicate if the listener wants to initiate capturepublic void removeEventListener(java.lang.String type, EventListener listener, boolean useCapture)
EventTarget
EventListener
is removed from an EventTarget
while it is processing an event, it will not be triggered by the current actions. EventListener
s can never be invoked after being removed.removeEventListener
with arguments which do not identify any currently registered EventListener
on the EventTarget
has no effect.removeEventListener
in interface EventTarget
public boolean dispatchEvent(Event evtArg) throws DOMException
dispatchEvent
in interface EventTarget
UNSPECIFIED_EVENT_TYPE:
- Raised if the Event's type was not specified by initializing the event before dispatchEvent was calledDOMException
public java.lang.String getDefaultValue()
null
if unspecified. Elena wanted mention of XML Schema's canonical lexical representation here. Why?getDefaultValue
in interface NodeEditVAL
public DOMStringList getEnumeratedValues()
DOMStringList
, as described in [ DOM Level 3 Core] , of distinct values for an attribute or an element declaration or null
if unspecified. Elena wanted mention of XML Schema's canonical lexical representation here. Why?getEnumeratedValues
in interface NodeEditVAL
public short canInsertBefore(Node newChild, Node refChild)
Node.insertBefore
operation would make this document not compliant with the VAL_INCOMPLETE
validity type.canInsertBefore
in interface NodeEditVAL
newChild
- Node
to be inserted.refChild
- Reference Node
.public short canRemoveChild(Node oldChild)
Node.removeChild
operation would make this document not compliant with the VAL_INCOMPLETE
validity type.canRemoveChild
in interface NodeEditVAL
oldChild
- Node
to be removed.public short canReplaceChild(Node newChild, Node oldChild)
Node.replaceChild
operation would make this document not compliant with the VAL_INCOMPLETE
validity type.canReplaceChild
in interface NodeEditVAL
newChild
- New Node
.oldChild
- Node
to be replaced.public short canAppendChild(Node newChild)
Node.appendChild
operation would make this document not compliant with the VAL_INCOMPLETE
validity type.canAppendChild
in interface NodeEditVAL
newChild
- Node
to be appended.public short nodeValidity(short wFValidityCheckLevel)
valType
. This operation doesn't normalize before checking if it is valid. To do so, one would need to explicitly call a normalize method. The difference between this method and the validateDocument
method on the DocumentVAL
interface is that validateDocument
only checks to determine whether the entire document is valid.nodeValidity
in interface NodeEditVAL
wFValidityCheckLevel
- Flag to tell at what level validity and well-formedness checking is done.public void addText(char[] ch, int start, int length) throws XMLDOMException
ch
- char array to addstart
- start index in the char arraylength
- no of chars to be addedXMLDOMException
- if text can't be added to this nodepublic java.lang.String getText()
XMLDocument.getText
returns "William Shakespeare".
public void reportSAXEvents(ContentHandler cntHandler) throws SAXException
SAXException
- thrown by SAX Callback functionspublic DocumentFragment transformNode(XSLStylesheet xsl) throws XSLException
xsl
- XSLStylesheet
to be used for transformationXSLException
- Raised if there is an error while doing the XSL transformation.public NodeList selectNodes(java.lang.String pattern, NSResolver nsr) throws XSLException
pattern
- XSL pattern to matchnsr
- NSResolver to resolve any namespace prefixes that occur in the given patternXSLException
- Raised if there is an error while doing the matchpublic NodeList selectNodes(java.lang.String pattern) throws XSLException
pattern
- XSL pattern to matchXSLException
- Raised if there is an error while doing the matchpublic Node selectSingleNode(java.lang.String pattern, NSResolver nsr) throws XSLException
pattern
- XSL pattern to matchnsr
- NSResolver to resolve any prefixes that occur in given patternXSLException
- Raised if there is an error while doing the matchpublic Node selectSingleNode(java.lang.String pattern) throws XSLException
pattern
- XSL pattern to matchXSLException
- Raised if there is an error while doing the matchpublic java.lang.String valueOf(java.lang.String pattern, NSResolver nsr) throws XSLException
pattern
- XSL pattern to matchnsr
- NSResolver to resolve any prefixes that occur in given patternXSLException
- Raised if there is an error while doing the matchpublic java.lang.String valueOf(java.lang.String pattern) throws XSLException
pattern
- XSL pattern to matchXSLException
- Raised if there is an error while doing the matchpublic boolean isNodeFlag(int flag)
public boolean isDocumentFlag(int flag)
public void setNodeFlag(int flag)
flag
- the node flagpublic void setNodeFlag(int flag, boolean val)
flag
- the node flagval
- boolean, the flag is set if val is true, otherwise resetpublic void setNodeFlag(int flag, int mask)
flag
- the node flagmask
- the mask for the multiple bitspublic void resetNodeFlag(int flag)
flag
- the node flagpublic int getPrimitiveTypeId()
public boolean getDebugMode()
public void setDebugInfo(int line, int col, java.lang.String sysid)
line
- the line numbercol
- the col numbersysid
- the system idpublic int getLineNumber()
public int getColumnNumber()
public java.lang.String getSystemId()
public XMLError getXMLError()
public void setProperty(java.lang.String propName, java.lang.Object propValue)
propName
- - Name of the propertypropValue
- - Value of the propertypublic java.lang.Object getProperty(java.lang.String propName)
propName
- - Name of the propertypublic void print(java.io.Writer out) throws java.io.IOException
out
- PrintWriter
to usejava.io.IOException
- if an error occurspublic void print(java.io.PrintWriter out) throws java.io.IOException
out
- PrintWriter
to usejava.io.IOException
- if an error occurspublic void print(java.io.OutputStream out) throws java.io.IOException
out
- OutputStream
to write tojava.io.IOException
- if an error occurspublic void print(java.io.OutputStream out, java.lang.String enc) throws java.io.IOException
out
- OutputStream
to write toenc
- Encoding to use for the outputjava.io.IOException
- if an invalid encoding was specified or if any other error occurspublic void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The ObjectOutput stream used to write the serialized/ compressed stream.java.io.IOException
- is thrown when there is an exception while writing the serialized/compressed stream.public void readExternal(java.io.ObjectInput inArg) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
inArg
- the ObjectInput used for reading the compressed streamjava.io.IOException
- is thrown when there is an error in reading the input stream.java.lang.ClassNotFoundException
- is thrown when the class is not foundpublic boolean equals(java.lang.Object obj)
obj
- the reference object with which to compare.true
if this object is the same as the obj argument; false
otherwise.public int hashCode()
java.util.Hashtable
.public long xdbGetNodeId()
|
Oracle® Application Server XML Java API Reference 10g Release 3 (10.1.3) B28238-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |