|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.dom.NodeWrapper
This class implements a wrapper for a Document. All the methods of the underlying document are called in a single thread.
Field Summary | |
protected HashTable |
bubblingListeners
The bubbling listeners table. |
protected HashTable |
capturingListeners
The capturing listeners table. |
protected DocumentWrapper |
documentWrapper
The owner document wrapper. |
protected Node |
node
The wrapped 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 |
Constructor Summary | |
NodeWrapper(DocumentWrapper dw,
Node n)
Creates a new NodeWrapper. |
Method Summary | |
void |
addEventListener(java.lang.String type,
EventListener listener,
boolean useCapture)
DOM: Implements EventTarget.addEventListener(String,EventListener,boolean) . |
Node |
appendChild(Node newChild)
DOM: Implements Node.appendChild(Node) . |
Node |
cloneNode(boolean deep)
DOM: Implements Node.cloneNode(boolean) . |
protected Attr |
createAttrWrapper(Attr n)
Creates a wrapper for the given Attr. |
protected Element |
createElementWrapper(Element n)
Creates a wrapper for the given Element. |
protected NamedNodeMap |
createNamedNodeMapWrapper(NamedNodeMap nm)
Creates a wrapper for the given node map. |
protected NodeList |
createNodeListWrapper(NodeList nl)
Creates a wrapper for the given node list. |
protected Node |
createNodeWrapper(Node n)
Creates a wrapper for the given node. |
protected Text |
createTextWrapper(Text t)
Creates a wrapper for the given Text. |
boolean |
dispatchEvent(Event evt)
DOM: Implements EventTarget.dispatchEvent(Event) . |
protected void |
finalize()
Called when the object is collectable. |
NamedNodeMap |
getAttributes()
DOM: Implements Node.getAttributes() . |
NodeList |
getChildNodes()
DOM: Implements Node.getChildNodes() . |
Node |
getFirstChild()
DOM: Implements Node.getFirstChild() . |
Node |
getLastChild()
DOM: Implements Node.getLastChild() . |
java.lang.String |
getLocalName()
DOM: Implements Node.getLocalName() . |
java.lang.String |
getNamespaceURI()
DOM: Implements Node.getNamespaceURI() . |
Node |
getNextSibling()
DOM: Implements Node.getNextSibling() . |
Node |
getNode()
Returns the wrapped node. |
java.lang.String |
getNodeName()
DOM: Implements Node.getNodeName() . |
short |
getNodeType()
DOM: Implements Node.getNodeType() . |
java.lang.String |
getNodeValue()
DOM: Implements Node.getNodeValue() . |
Document |
getOwnerDocument()
DOM: Implements Node.getOwnerDocument() . |
Node |
getParentNode()
DOM: Implements Node.getParentNode() . |
java.lang.String |
getPrefix()
DOM: Implements Node.getPrefix() . |
Node |
getPreviousSibling()
DOM: Implements Node.getPreviousSibling() . |
boolean |
hasAttributes()
DOM: Implements Node.hasAttributes() . |
boolean |
hasChildNodes()
DOM: Implements Node.hasChildNodes() . |
Node |
insertBefore(Node newChild,
Node refChild)
DOM: Implements Node.insertBefore(Node, Node) . |
protected void |
invokeAndWait(java.lang.Runnable r)
Invokes the given Runnable from the associated RunnableQueue thread. |
protected void |
invokeLater(java.lang.Runnable r)
Invokes the given Runnable from the associated RunnableQueue thread. |
boolean |
isSupported(java.lang.String feature,
java.lang.String version)
DOM: Implements Node.isSupported(String,String) . |
void |
normalize()
DOM: Implements Node.normalize() . |
Node |
removeChild(Node oldChild)
DOM: Implements Node.removeChild(Node) . |
void |
removeEventListener(java.lang.String type,
EventListener listener,
boolean useCapture)
DOM: Implements EventTarget.removeEventListener(String,EventListener,boolean) . |
Node |
replaceChild(Node newChild,
Node oldChild)
DOM: Implements Node.replaceChild(Node, Node) . |
void |
setNodeValue(java.lang.String nodeValue)
DOM: Implements Node.setNodeValue(String) . |
void |
setPrefix(java.lang.String prefix)
DOM: Implements Node.setPrefix(String) . |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected DocumentWrapper documentWrapper
protected Node node
protected HashTable capturingListeners
protected HashTable bubblingListeners
Constructor Detail |
public NodeWrapper(DocumentWrapper dw, Node n)
Method Detail |
public Node getNode()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
public java.lang.String getNodeName()
Node.getNodeName()
.getNodeName
in interface Node
public short getNodeType()
Node.getNodeType()
.getNodeType
in interface Node
public java.lang.String getNodeValue() throws DOMException
Node.getNodeValue()
.getNodeValue
in interface Node
org.w3c.dom.Node
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.DOMException
- DOMSTRING_SIZE_ERR: Raised when it would return more characters than
fit in a DOMString
variable on the implementation
platform.public void setNodeValue(java.lang.String nodeValue) throws DOMException
Node.setNodeValue(String)
.setNodeValue
in interface Node
public Node getParentNode()
Node.getParentNode()
.getParentNode
in interface Node
public NodeList getChildNodes()
Node.getChildNodes()
.getChildNodes
in interface Node
public Node getFirstChild()
Node.getFirstChild()
.getFirstChild
in interface Node
public Node getLastChild()
Node.getLastChild()
.getLastChild
in interface Node
public Node getPreviousSibling()
Node.getPreviousSibling()
.getPreviousSibling
in interface Node
public Node getNextSibling()
Node.getNextSibling()
.getNextSibling
in interface Node
public boolean hasAttributes()
Node.hasAttributes()
.hasAttributes
in interface Node
org.w3c.dom.Node
true
if this node has any attributes,
false
otherwise.public NamedNodeMap getAttributes()
Node.getAttributes()
.getAttributes
in interface Node
public Document getOwnerDocument()
Node.getOwnerDocument()
.getOwnerDocument
in interface Node
public java.lang.String getNamespaceURI()
Node.getNamespaceURI()
.getNamespaceURI
in interface Node
public Node insertBefore(Node newChild, Node refChild) throws DOMException
Node.insertBefore(Node, Node)
.insertBefore
in interface Node
org.w3c.dom.Node
newChildThe
- node to insert.refChildThe
- 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
Node.replaceChild(Node, Node)
.replaceChild
in interface Node
org.w3c.dom.Node
newChildThe
- new node to put in the child list.oldChildThe
- 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 if
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
Node.removeChild(Node)
.removeChild
in interface Node
org.w3c.dom.Node
oldChildThe
- node being removed.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
oldChild
is not a child of
this node.public Node appendChild(Node newChild) throws DOMException
Node.appendChild(Node)
.appendChild
in interface Node
org.w3c.dom.Node
newChildThe
- 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 boolean hasChildNodes()
Node.hasChildNodes()
.hasChildNodes
in interface Node
org.w3c.dom.Node
true
if this node has any children,
false
otherwise.public Node cloneNode(boolean deep)
Node.cloneNode(boolean)
.cloneNode
in interface Node
org.w3c.dom.Node
deepIf
- 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()
Node.normalize()
.normalize
in interface Node
public boolean isSupported(java.lang.String feature, java.lang.String version)
Node.isSupported(String,String)
.isSupported
in interface Node
org.w3c.dom.Node
featureThe
- name of the feature to test. This is the same name
which can be passed to the method hasFeature
on
DOMImplementation
.versionThis
- is the version number of the feature to test. In
Level 2, version 1, this is the string "2.0". If the version is not
specified, supporting any version of the feature will cause the
method to return true
.true
if the specified feature is
supported on this node, false
otherwise.public java.lang.String getPrefix()
Node.getPrefix()
.getPrefix
in interface Node
org.w3c.dom.Node
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
illegal character.
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
Node.setPrefix(String)
.setPrefix
in interface Node
public java.lang.String getLocalName()
Node.getLocalName()
.getLocalName
in interface Node
public void addEventListener(java.lang.String type, EventListener listener, boolean useCapture)
EventTarget.addEventListener(String,EventListener,boolean)
.addEventListener
in interface EventTarget
org.w3c.dom.events.EventTarget
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)
EventTarget.removeEventListener(String,EventListener,boolean)
.removeEventListener
in interface EventTarget
org.w3c.dom.events.EventTarget
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 EventException
EventTarget.dispatchEvent(Event)
.dispatchEvent
in interface EventTarget
org.w3c.dom.events.EventTarget
evtSpecifies
- the event type, behavior, and contextual
information to be used in processing the event.dispatchEvent
indicates
whether any of the listeners which handled the event called
preventDefault
. If preventDefault
was
called the value is false, else the value is true.EventException
- UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event
's type
was not specified by initializing the event before
dispatchEvent
was called. Specification of the
Event
's type as null
or an empty string
will also trigger this exception.protected void invokeAndWait(java.lang.Runnable r)
protected void invokeLater(java.lang.Runnable r)
protected Node createNodeWrapper(Node n)
protected Attr createAttrWrapper(Attr n)
protected Text createTextWrapper(Text t)
protected Element createElementWrapper(Element n)
protected NodeList createNodeListWrapper(NodeList nl)
protected NamedNodeMap createNamedNodeMapWrapper(NamedNodeMap nm)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |