|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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.
This DOM Nodes extending XMLNode instead of XMLNSNode have fixed
Nodename defined by DOM specification. Also only node that cannot have child
nodes extend this class.
Field Summary |
Type | Field |
---|---|
static short |
ATTRDECL
A attribute declaration node |
static java.lang.String |
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 java.lang.String |
noncapturing
|
static java.lang.String |
RANGE_DELETE_EVENT
|
static java.lang.String |
RANGE_DELETETEXT_EVENT
|
static java.lang.String |
RANGE_INSERT_EVENT
|
static java.lang.String |
RANGE_INSERTTEXT_EVENT
|
static java.lang.String |
RANGE_REPLACE_EVENT
|
static java.lang.String |
RANGE_SETTEXT_EVENT
|
static java.lang.String |
TRAVERSAL_DELETE_EVENT
|
static java.lang.String |
TRAVERSAL_REPLACE_EVENT
|
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 oracle.xml.comp.CXMLConstants |
ATTR_DEF,
ATTR_TOKEN,
ATTRDECL_DEF,
CDATA_DEF,
CHAR_DEF,
COMMENT_DEF,
CXML_VERSION,
cXMLFILE,
cXMLFILE_LEN,
DEBUG,
DTD_DEF,
ELEMENTDECL_DEF,
END,
ENTITY_DEF,
ENTITYREF_DEF,
META_ID_MAX,
names,
NOTATION_DEF,
NS_DEF,
NULLSTR,
PI_DEF,
PREFIX_DEF,
TAG_DEF,
TAG_TOKEN,
TOKEN_ONLY,
XMLDECL_DEF |
Constructor Summary |
Type | Constructor |
---|---|
protected |
XMLNode()
Constructs a new XMLNode having the given name and type |
Method Summary |
Type | Method |
---|---|
void |
addEventListener(java.lang.String type,
EventListener listener,
boolean useCapture)
DOMEvents |
Node |
appendChild(Node newChild)
Adds the node newChild to the end of the list of children of
this node. |
Node |
cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
boolean |
dispatchEvent(Event evt)
This method allows the dispatch of events into the implementations event model |
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 |
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()
Returns the local part of the qualified name of this node. |
java.lang.String |
getNamespace()
|
java.lang.String |
getNamespaceURI()
The namespace URI of this node, or null if it is
unspecified. |
Node |
getNextSibling()
Gets The node immediately following this node. |
java.lang.String |
getNodeLocalName()
|
java.lang.String |
getNodeName()
Gets the name of the node |
java.lang.String |
getNodePrefix()
|
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()
The namespace prefix of this node, or null if it is
unspecified. |
Node |
getPreviousSibling()
Gets the node immediately preceding this node. |
java.lang.Object |
getProperty(java.lang.String propName)
Get a property of the node |
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. |
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. |
Node |
insertBefore(Node newChild,
Node refChild)
Inserts the node newChild before the existing child node
refChild . |
boolean |
isNodeFlag(int flag)
|
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. |
void |
normalize()
Puts all Text nodes in the full depth of the sub-tree
underneath this Node , including attribute nodes, into a
"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 |
readChildNodes(oracle.xml.io.XMLObjectInput in,
oracle.xml.comp.CXMLContext cxmlContext)
|
void |
readExternal(java.io.ObjectInput inArg)
|
void |
readExternal(oracle.xml.io.XMLObjectInput in,
oracle.xml.comp.CXMLContext cxmlContext)
|
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)
|
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 |
NodeList |
selectNodes(XSLNodeSetInt expr)
|
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)
|
void |
setNodeValue(java.lang.String nodeValue)
Sets the value of this node, depending on its type |
void |
setPrefix(java.lang.String prefix)
|
void |
setProperty(java.lang.String propName,
java.lang.Object propValue)
Set a property of the node |
boolean |
supports(java.lang.String feature,
java.lang.String version)
Deprecated. Use isSupported instead |
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)
DOM Serialization/Compression API's |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
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 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
having the given name and typetag
- Name of the nodeMethod Detail |
public java.lang.String getNodeName()
public short getNodeType()
public java.lang.String getNodeValue() throws DOMException
DOMString
variable on the implementation
platform.public void setNodeValue(java.lang.String nodeValue) throws DOMException
DOMString
variable on the implementation
platform.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
.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.public Node getFirstChild()
null
.public Node getLastChild()
null
.public Node getPreviousSibling()
null
.public Node getNextSibling()
null
.public NamedNodeMap getAttributes()
NamedNodeMap
containing the attributes of this node
(if it is an Element
) or null
otherwise.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
.public boolean hasChildNodes()
true
if the node has any children,
false
if the node has no children.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.newChild
- The node to insert.refChild
- The reference node, i.e., the node before which the new
node must be inserted.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.newChild
- The new node to put in the child list.oldChild
- The node being replaced in the list.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 removeChild(Node oldChild) throws DOMException
oldChild
from the list
of children, and returns it.oldChild
- The node being removed.oldChild
is not a child of
this 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.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 nodenewChild
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 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.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 DocumentFragment transformNode(XSLStylesheet xsl) throws XSLException
xsl
- XSLStylesheet
to be used for transformationpublic 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 patternpublic NodeList selectNodes(XSLNodeSetInt expr) throws XSLException
public NodeList selectNodes(java.lang.String pattern) throws XSLException
pattern
- XSL pattern to 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 patternpublic Node selectSingleNode(java.lang.String pattern) throws XSLException
pattern
- XSL pattern to 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 patternpublic java.lang.String valueOf(java.lang.String pattern) throws XSLException
pattern
- XSL pattern to matchpublic 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 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.PrintWriter out) throws java.io.IOException
out
- PrintWriter
to usepublic void print(java.io.OutputStream out) throws java.io.IOException
out
- OutputStream
to write topublic void print(java.io.OutputStream out, java.lang.String enc) throws java.io.IOException
out
- OutputStream
to write toenc
- Encoding to use for the outputpublic void reportSAXEvents(ContentHandler cntHandler) throws SAXException
ContentHandler
- cntHandlerpublic java.lang.String getText()
XMLDocument.getText
returns "William Shakespeare".
public void normalize()
Text
nodes in the full depth of the sub-tree
underneath this Node
, including attribute nodes, into a
"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. This can
be used to ensure that the DOM view of a document is the same as if
it were saved and re-loaded, and is useful when operations (such as
XPointer lookups) that depend on a particular document tree
structure are to be used.In cases where the document contains
CDATASections
, the normalize operation alone may not be
sufficient, since XPointers do not differentiate between
Text
nodes and CDATASection
nodes.public boolean supports(java.lang.String feature, java.lang.String version)
String
- feature ,String versionpublic boolean isSupported(java.lang.String feature, java.lang.String version)
String
- feature ,String versionpublic java.lang.String getNamespace()
public java.lang.String getNamespaceURI()
null
if it is
unspecified.
ELEMENT_NODE
and
ATTRIBUTE_NODE
and nodes created with a DOM Level 1
method, such as createElement
from the
Document
interface, this is always null
.Per
the Namespaces in XML Specification an attribute does not inherit
its namespace from the element it is attached to. If an attribute is
not explicitly given a namespace, it simply has no namespace.public java.lang.String getNodePrefix()
public java.lang.String getPrefix()
null
if it is
unspecified.
nodeName
attribute, which holds the qualified name, as
well as the tagName
and name
attributes of
the Element
and Attr
interfaces, when
applicable.
namespaceURI
and localName
do not change.
ELEMENT_NODE
and
ATTRIBUTE_NODE
and nodes created with a DOM Level 1
method, such as createElement
from the
Document
interface, this is always null
.prefix
is
malformed, if the namespaceURI
of this node is
null
, if the specified prefix is "xml" and the
namespaceURI
of this node is different from "
http://www.w3.org/XML/1998/namespace", if this node is an attribute
and the specified prefix is "xmlns" and the
namespaceURI
of this node is different from "
http://www.w3.org/2000/xmlns/", or if this node is an attribute and
the qualifiedName
of this node is "xmlns" .public void setPrefix(java.lang.String prefix) throws DOMException
public java.lang.String getNodeLocalName()
public java.lang.String getLocalName()
ELEMENT_NODE
and
ATTRIBUTE_NODE
and nodes created with a DOM Level 1
method, such as createElement
from the
Document
interface, this is always null
.public boolean hasAttributes()
true
if this node has any attributes,
false
otherwise.public void addEventListener(java.lang.String type, EventListener listener, boolean useCapture)
typeThe
- event type for which the user is registeringlistenerThe
- listener
parameter takes an interface
implemented by the user which contains the methods to be called
when the event occurs.useCaptureIf
- true, useCapture
indicates that the
user wishes to initiate capture. After initiating capture, all
events of the specified type will be dispatched to the registered
EventListener
before being dispatched to any
EventTargets
beneath them in the tree. Events which
are bubbling upward through the tree will not trigger an
EventListener
designated to use capture.public void removeEventListener(java.lang.String type, EventListener listener, boolean useCapture)
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.typeSpecifies
- the event type of the EventListener
being removed.listenerThe
- EventListener
parameter indicates the
EventListener
to be removed.useCaptureSpecifies
- whether the EventListener
being removed was registered as a capturing listener or not. If a
listener was registered twice, one with capture and one without,
each must be removed separately. Removal of a capturing listener
does not affect a non-capturing version of the same listener, and
vice versa.public boolean dispatchEvent(Event evt) throws DOMException
public boolean isNodeFlag(int flag)
public void setNodeFlag(int flag)
public void resetNodeFlag(int flag)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
public void readExternal(java.io.ObjectInput inArg) throws java.io.IOException, java.lang.ClassNotFoundException
public void readExternal(oracle.xml.io.XMLObjectInput in, oracle.xml.comp.CXMLContext cxmlContext) throws java.io.IOException, java.lang.ClassNotFoundException
public void readChildNodes(oracle.xml.io.XMLObjectInput in, oracle.xml.comp.CXMLContext cxmlContext) throws java.io.IOException, java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |