java.lang.Object
io.sf.carte.echosvg.dom.AbstractNode
- All Implemented Interfaces:
NodeEventTarget
,ExtendedNode
,NodeXBL
,XBLManagerData
,Serializable
,EventTarget
,Node
- Direct Known Subclasses:
AbstractChildNode
,AbstractNotation
,AbstractParentNode
public abstract class AbstractNode
extends Object
implements ExtendedNode, NodeXBL, XBLManagerData, Serializable
This class implements the
Node
interface.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final short
static final short
static final short
static final short
static final short
static final short
static final NodeList
An empty instance of NodeList.protected EventSupport
The event support.protected Object
The XBL manager data.protected AbstractDocument
The owner document.User data.User data handlers.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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEventListener
(String type, EventListener listener, boolean useCapture) DOM: ImplementsEventTarget.addEventListener(String,EventListener,boolean)
.void
addEventListenerNS
(String namespaceURI, String type, EventListener listener, boolean useCapture, Object evtGroup) appendChild
(Node newChild) DOM: ImplementsNode.appendChild(Node)
.protected void
checkChildType
(Node n, boolean replace) Checks the validity of a node to be inserted.cloneNode
(boolean deep) DOM: ImplementsNode.cloneNode(boolean)
.short
compareDocumentPosition
(Node other) DOM: ImplementsNode.compareDocumentPosition(Node)
.protected boolean
compareNamedNodeMaps
(NamedNodeMap nnm1, NamedNodeMap nnm2) Compare two NamedNodeMaps for equality.protected boolean
compareStrings
(String s1, String s2) Compare two strings for equality.protected Node
Copy the fields of the current node into the given node.createDOMException
(short type, String key, Object[] args) Creates an exception with the appropriate error message.protected Node
deepCopyInto
(Node n) Deeply copy the fields of the current node into the given node.protected Node
deepExport
(Node n, AbstractDocument d) Deeply exports this node to the given document.boolean
dispatchEvent
(Event evt) DOM: ImplementsEventTarget.dispatchEvent(Event)
.protected Node
export
(Node n, AbstractDocument d) Exports this node to the given document.protected void
fireDOMCharacterDataModifiedEvent
(String oldv, String newv) Fires a DOMCharacterDataModified event.void
Recursively fires a DOMNodeInsertedIntoDocument event.void
Recursively fires a DOMNodeRemovedFromDocument event.protected void
fireUserDataHandlers
(short type, Node oldNode, Node newNode) Fire any UserDataHandlers on the given oldNode.DOM: ImplementsNode.getAttributes()
.DOM: ImplementsNode.getBaseURI()
.static String
getBaseURI
(Node n) protected String
getCascadedXMLBase
(Node node) Returns the xml:base attribute value of the given element, resolving any dependency on parent bases if needed.DOM: ImplementsNode.getChildNodes()
.protected AbstractDocument
Returns the current document.Returns the event support instance for this node, or null if any.getFeature
(String feature, String version) DOM: ImplementsNode.getFeature(String,String)
.DOM: ImplementsNode.getFirstChild()
.DOM: ImplementsNode.getLastChild()
.DOM: ImplementsNode.getLocalName()
.Returns the XBL manager associated data for this node.DOM: ImplementsNode.getNamespaceURI()
.DOM: ImplementsNode.getNextSibling()
.DOM: ImplementsNode.getNodeValue()
.DOM: ImplementsNode.getOwnerDocument()
.DOM: ImplementsNode.getParentNode()
.ImplementsNodeEventTarget.getParentNodeEventTarget()
.DOM: ImplementsNode.getPrefix()
.DOM: ImplementsNode.getPreviousSibling()
.DOM: ImplementsNode.getTextContent()
.getUserData
(String key) DOM: ImplementsNode.getUserData(String)
.Get the bound element whose shadow tree this current node resides in.Get the list of child nodes of this node in the fully flattened tree.Get the xbl:definition elements currently binding this element.Get the first child node of this node in the fully flattened tree.Get the first element child of this node in the fully flattened tree.Get the last child node of this node in the fully flattened tree.Get the last element child of this node in the fully flattened tree.Get the first element that follows the current node in the xblParentNode's xblChildNodes list.Get the node which directly follows the current node in the xblParentNode's xblChildNodes list.Get the parent of this node in the fully flattened tree.Get the first element that precedes the current node in the xblParentNode's xblChildNodes list.Get the node which directly precedes the current node in the xblParentNode's xblChildNodes list.Get the list of child nodes of this node in the fully flattened tree that are within the same shadow scope.Get the shadow tree of this node.boolean
DOM: ImplementsNode.hasAttributes()
.boolean
DOM: ImplementsNode.hasChildNodes()
.boolean
hasEventListenerNS
(String namespaceURI, String type) DOM: ImplementsEventTarget.hasEventListenerNS(String,String)
from an old draft of DOM Level 3 Events.Initializes the event support instance for this node if it has not been already, and returns it.insertBefore
(Node newChild, Node refChild) DOM: ImplementsNode.insertBefore(Node, Node)
.boolean
isDefaultNamespace
(String namespaceURI) DOM: ImplementsNode.isDefaultNamespace(String)
.boolean
isEqualNode
(Node other) DOM: ImplementsNode.isEqualNode(Node)
.boolean
isSameNode
(Node other) DOM: ImplementsNode.isSameNode(Node)
.boolean
isSupported
(String feature, String version) DOM: ImplementsNode.isSupported(String,String)
.protected String
lookupNamespacePrefix
(String namespaceURI, Element originalElement) Helper function forlookupPrefix(java.lang.String)
.lookupNamespaceURI
(String prefix) DOM: ImplementsNode.lookupNamespaceURI(String)
.lookupPrefix
(String namespaceURI) DOM: ImplementsNode.lookupPrefix(String)
.protected abstract Node
newNode()
Returns a new uninitialized instance of this object's class.void
DOM: ImplementsNode.normalize()
.removeChild
(Node oldChild) DOM: ImplementsNode.removeChild(Node)
.void
removeEventListener
(String type, EventListener listener, boolean useCapture) DOM: ImplementsEventTarget.removeEventListener(String,EventListener,boolean)
.void
removeEventListenerNS
(String namespaceURI, String type, EventListener listener, boolean useCapture) replaceChild
(Node newChild, Node oldChild) DOM: ImplementsNode.replaceChild(Node, Node)
.void
setManagerData
(Object data) Sets the XBL manager associated data for this node.void
Sets the node immediately following this node.void
Sets the name of this node.void
setNodeValue
(String nodeValue) DOM: ImplementsNode.setNodeValue(String)
.void
setOwnerDocument
(Document doc) Sets the owner document of this node.void
Sets the parent node.void
DOM: ImplementsNode.setPrefix(String)
.void
Sets the node immediately preceding this node.void
setSpecified
(boolean v) Sets the value of the specified attribute.void
DOM: ImplementsNode.setTextContent(String)
.setUserData
(String key, Object data, UserDataHandler handler) DOM: ImplementsNode.setUserData(String,Object,UserDataHandler)
.boolean
willTriggerNS
(String namespaceURI, String type) DOM: ImplementsEventTarget#willTriggerNS(String,String)
from an old draft of DOM Level 3 Events.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.sf.carte.echosvg.dom.ExtendedNode
isReadonly, setReadonly
Methods inherited from interface org.w3c.dom.Node
getNodeName, getNodeType
-
Field Details
-
EMPTY_NODE_LIST
An empty instance of NodeList. -
ownerDocument
The owner document. -
eventSupport
The event support. -
userData
User data. -
userDataHandlers
User data handlers. -
managerData
The XBL manager data. -
DOCUMENT_POSITION_DISCONNECTED
public static final short DOCUMENT_POSITION_DISCONNECTED- See Also:
-
DOCUMENT_POSITION_PRECEDING
public static final short DOCUMENT_POSITION_PRECEDING- See Also:
-
DOCUMENT_POSITION_FOLLOWING
public static final short DOCUMENT_POSITION_FOLLOWING- See Also:
-
DOCUMENT_POSITION_CONTAINS
public static final short DOCUMENT_POSITION_CONTAINS- See Also:
-
DOCUMENT_POSITION_CONTAINED_BY
public static final short DOCUMENT_POSITION_CONTAINED_BY- See Also:
-
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC- See Also:
-
-
Constructor Details
-
AbstractNode
public AbstractNode()
-
-
Method Details
-
setNodeName
Sets the name of this node. Do nothing.- Specified by:
setNodeName
in interfaceExtendedNode
-
setOwnerDocument
Sets the owner document of this node.- Specified by:
setOwnerDocument
in interfaceExtendedNode
-
setSpecified
public void setSpecified(boolean v) Sets the value of the specified attribute. This method only applies to Attr objects.- Specified by:
setSpecified
in interfaceExtendedNode
-
getNodeValue
DOM: ImplementsNode.getNodeValue()
.- Specified by:
getNodeValue
in interfaceNode
- Returns:
- null.
- Throws:
DOMException
-
setNodeValue
DOM: ImplementsNode.setNodeValue(String)
. Do nothing.- Specified by:
setNodeValue
in interfaceNode
- Throws:
DOMException
-
getParentNode
DOM: ImplementsNode.getParentNode()
.- Specified by:
getParentNode
in interfaceNode
- Returns:
- null.
-
setParentNode
Sets the parent node. Throws a HIERARCHY_REQUEST_ERRDOMException
.- Specified by:
setParentNode
in interfaceExtendedNode
-
getChildNodes
DOM: ImplementsNode.getChildNodes()
.- Specified by:
getChildNodes
in interfaceNode
- Returns:
EMPTY_NODE_LIST
.
-
getFirstChild
DOM: ImplementsNode.getFirstChild()
.- Specified by:
getFirstChild
in interfaceNode
- Returns:
- null.
-
getLastChild
DOM: ImplementsNode.getLastChild()
.- Specified by:
getLastChild
in interfaceNode
- Returns:
- null.
-
setPreviousSibling
Sets the node immediately preceding this node. Throws a HIERARCHY_REQUEST_ERRDOMException
.- Specified by:
setPreviousSibling
in interfaceExtendedNode
-
getPreviousSibling
DOM: ImplementsNode.getPreviousSibling()
.- Specified by:
getPreviousSibling
in interfaceNode
- Returns:
- null.
-
setNextSibling
Sets the node immediately following this node. Throws a HIERARCHY_REQUEST_ERRDOMException
.- Specified by:
setNextSibling
in interfaceExtendedNode
-
getNextSibling
DOM: ImplementsNode.getNextSibling()
.- Specified by:
getNextSibling
in interfaceNode
- Returns:
- null.
-
hasAttributes
public boolean hasAttributes()DOM: ImplementsNode.hasAttributes()
.- Specified by:
hasAttributes
in interfaceNode
- Returns:
- false.
-
getAttributes
DOM: ImplementsNode.getAttributes()
.- Specified by:
getAttributes
in interfaceNode
- Returns:
- null.
-
getOwnerDocument
DOM: ImplementsNode.getOwnerDocument()
.- Specified by:
getOwnerDocument
in interfaceNode
- Returns:
ownerDocument
.
-
getNamespaceURI
DOM: ImplementsNode.getNamespaceURI()
.- Specified by:
getNamespaceURI
in interfaceNode
- Returns:
- null.
-
insertBefore
DOM: ImplementsNode.insertBefore(Node, Node)
. Throws a HIERARCHY_REQUEST_ERRDOMException
.- Specified by:
insertBefore
in interfaceNode
- Throws:
DOMException
-
replaceChild
DOM: ImplementsNode.replaceChild(Node, Node)
. Throws a HIERARCHY_REQUEST_ERRDOMException
.- Specified by:
replaceChild
in interfaceNode
- Throws:
DOMException
-
removeChild
DOM: ImplementsNode.removeChild(Node)
. Throws a HIERARCHY_REQUEST_ERRDOMException
.- Specified by:
removeChild
in interfaceNode
- Throws:
DOMException
-
appendChild
DOM: ImplementsNode.appendChild(Node)
. Throws a HIERARCHY_REQUEST_ERRDOMException
.- Specified by:
appendChild
in interfaceNode
- Throws:
DOMException
-
hasChildNodes
public boolean hasChildNodes()DOM: ImplementsNode.hasChildNodes()
.- Specified by:
hasChildNodes
in interfaceNode
- Returns:
- false.
-
cloneNode
DOM: ImplementsNode.cloneNode(boolean)
. -
normalize
public void normalize()DOM: ImplementsNode.normalize()
. Do nothing. -
isSupported
DOM: ImplementsNode.isSupported(String,String)
.- Specified by:
isSupported
in interfaceNode
-
getPrefix
DOM: ImplementsNode.getPrefix()
. -
setPrefix
DOM: ImplementsNode.setPrefix(String)
.- Specified by:
setPrefix
in interfaceNode
- Throws:
DOMException
-
getLocalName
DOM: ImplementsNode.getLocalName()
.- Specified by:
getLocalName
in interfaceNode
-
createDOMException
Creates an exception with the appropriate error message. -
getCascadedXMLBase
Returns the xml:base attribute value of the given element, resolving any dependency on parent bases if needed. -
getBaseURI
DOM: ImplementsNode.getBaseURI()
.- Specified by:
getBaseURI
in interfaceNode
-
getBaseURI
-
compareDocumentPosition
DOM: ImplementsNode.compareDocumentPosition(Node)
. XXX Doesn't handle notation or entity nodes.- Specified by:
compareDocumentPosition
in interfaceNode
- Throws:
DOMException
-
getTextContent
DOM: ImplementsNode.getTextContent()
.- Specified by:
getTextContent
in interfaceNode
-
setTextContent
DOM: ImplementsNode.setTextContent(String)
.- Specified by:
setTextContent
in interfaceNode
- Throws:
DOMException
-
isSameNode
DOM: ImplementsNode.isSameNode(Node)
.- Specified by:
isSameNode
in interfaceNode
-
lookupPrefix
DOM: ImplementsNode.lookupPrefix(String)
.- Specified by:
lookupPrefix
in interfaceNode
-
lookupNamespacePrefix
Helper function forlookupPrefix(java.lang.String)
. -
isDefaultNamespace
DOM: ImplementsNode.isDefaultNamespace(String)
.- Specified by:
isDefaultNamespace
in interfaceNode
-
lookupNamespaceURI
DOM: ImplementsNode.lookupNamespaceURI(String)
.- Specified by:
lookupNamespaceURI
in interfaceNode
-
isEqualNode
DOM: ImplementsNode.isEqualNode(Node)
.- Specified by:
isEqualNode
in interfaceNode
-
compareStrings
Compare two strings for equality. -
compareNamedNodeMaps
Compare two NamedNodeMaps for equality. -
getFeature
DOM: ImplementsNode.getFeature(String,String)
.- Specified by:
getFeature
in interfaceNode
-
getUserData
DOM: ImplementsNode.getUserData(String)
.- Specified by:
getUserData
in interfaceNode
-
setUserData
DOM: ImplementsNode.setUserData(String,Object,UserDataHandler)
.- Specified by:
setUserData
in interfaceNode
-
fireUserDataHandlers
Fire any UserDataHandlers on the given oldNode. -
addEventListener
DOM: ImplementsEventTarget.addEventListener(String,EventListener,boolean)
.- Specified by:
addEventListener
in interfaceEventTarget
-
addEventListenerNS
public void addEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture, Object evtGroup) - Specified by:
addEventListenerNS
in interfaceNodeEventTarget
- Parameters:
namespaceURI
- Specifies theEvent.namespaceURI
associated with the event for which the user is registering.type
- Refer to theEventTarget.addEventListener()
method for a description of this parameter.listener
- Refer to theEventTarget.addEventListener()
method for a description of this parameter.useCapture
- Refer to theEventTarget.addEventListener()
method for a description of this parameter.evtGroup
- The object that represents the event group to associate with theEventListener
(see also ). Usenull
to attach the event listener to the default group.
-
removeEventListener
DOM: ImplementsEventTarget.removeEventListener(String,EventListener,boolean)
.- Specified by:
removeEventListener
in interfaceEventTarget
-
removeEventListenerNS
public void removeEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture) - Specified by:
removeEventListenerNS
in interfaceNodeEventTarget
- Parameters:
namespaceURI
- Specifies theEvent.namespaceURI
associated with the event for which the user registered the event listener.type
- Refer to theEventTarget.removeEventListener()
method for a description of this parameter.listener
- Refer to theEventTarget.removeEventListener()
method for a description of this parameter.useCapture
- Refer to theEventTarget.removeEventListener()
method for a description of this parameter.
-
getParentNodeEventTarget
ImplementsNodeEventTarget.getParentNodeEventTarget()
.- Specified by:
getParentNodeEventTarget
in interfaceNodeEventTarget
-
dispatchEvent
DOM: ImplementsEventTarget.dispatchEvent(Event)
.- Specified by:
dispatchEvent
in interfaceEventTarget
- Specified by:
dispatchEvent
in interfaceNodeEventTarget
- Parameters:
evt
- The event to be dispatched.- Returns:
- Indicates whether any of the listeners which handled the event called
Event.preventDefault()
. IfEvent.preventDefault()
was called the returned value isfalse
, else it istrue
. - Throws:
EventException
- UNSPECIFIED_EVENT_TYPE_ERR: Raised if theEvent.type
was not specified by initializing the event beforedispatchEvent
was called. Specification of theEvent.type
asnull
or an empty string will also trigger this exception.
DISPATCH_REQUEST_ERR: Raised if theEvent
object is already being dispatched.
-
willTriggerNS
DOM: ImplementsEventTarget#willTriggerNS(String,String)
from an old draft of DOM Level 3 Events. -
hasEventListenerNS
DOM: ImplementsEventTarget.hasEventListenerNS(String,String)
from an old draft of DOM Level 3 Events. -
getEventSupport
Returns the event support instance for this node, or null if any.- Specified by:
getEventSupport
in interfaceNodeEventTarget
-
initializeEventSupport
Initializes the event support instance for this node if it has not been already, and returns it. -
fireDOMNodeInsertedIntoDocumentEvent
public void fireDOMNodeInsertedIntoDocumentEvent()Recursively fires a DOMNodeInsertedIntoDocument event. -
fireDOMNodeRemovedFromDocumentEvent
public void fireDOMNodeRemovedFromDocumentEvent()Recursively fires a DOMNodeRemovedFromDocument event. -
fireDOMCharacterDataModifiedEvent
Fires a DOMCharacterDataModified event. -
getCurrentDocument
Returns the current document. -
newNode
Returns a new uninitialized instance of this object's class. -
export
Exports this node to the given document. -
deepExport
Deeply exports this node to the given document. -
copyInto
Copy the fields of the current node into the given node.- Parameters:
n
- a node of the type of this.
-
deepCopyInto
Deeply copy the fields of the current node into the given node.- Parameters:
n
- a node of the type of this.
-
checkChildType
Checks the validity of a node to be inserted. -
getXblParentNode
Get the parent of this node in the fully flattened tree.- Specified by:
getXblParentNode
in interfaceNodeXBL
-
getXblChildNodes
Get the list of child nodes of this node in the fully flattened tree.- Specified by:
getXblChildNodes
in interfaceNodeXBL
-
getXblScopedChildNodes
Get the list of child nodes of this node in the fully flattened tree that are within the same shadow scope.- Specified by:
getXblScopedChildNodes
in interfaceNodeXBL
-
getXblFirstChild
Get the first child node of this node in the fully flattened tree.- Specified by:
getXblFirstChild
in interfaceNodeXBL
-
getXblLastChild
Get the last child node of this node in the fully flattened tree.- Specified by:
getXblLastChild
in interfaceNodeXBL
-
getXblPreviousSibling
Get the node which directly precedes the current node in the xblParentNode's xblChildNodes list.- Specified by:
getXblPreviousSibling
in interfaceNodeXBL
-
getXblNextSibling
Get the node which directly follows the current node in the xblParentNode's xblChildNodes list.- Specified by:
getXblNextSibling
in interfaceNodeXBL
-
getXblFirstElementChild
Get the first element child of this node in the fully flattened tree.- Specified by:
getXblFirstElementChild
in interfaceNodeXBL
-
getXblLastElementChild
Get the last element child of this node in the fully flattened tree.- Specified by:
getXblLastElementChild
in interfaceNodeXBL
-
getXblPreviousElementSibling
Get the first element that precedes the current node in the xblParentNode's xblChildNodes list.- Specified by:
getXblPreviousElementSibling
in interfaceNodeXBL
-
getXblNextElementSibling
Get the first element that follows the current node in the xblParentNode's xblChildNodes list.- Specified by:
getXblNextElementSibling
in interfaceNodeXBL
-
getXblBoundElement
Get the bound element whose shadow tree this current node resides in.- Specified by:
getXblBoundElement
in interfaceNodeXBL
-
getXblShadowTree
Get the shadow tree of this node.- Specified by:
getXblShadowTree
in interfaceNodeXBL
-
getXblDefinitions
Get the xbl:definition elements currently binding this element.- Specified by:
getXblDefinitions
in interfaceNodeXBL
-
getManagerData
Returns the XBL manager associated data for this node.- Specified by:
getManagerData
in interfaceXBLManagerData
-
setManagerData
Sets the XBL manager associated data for this node.- Specified by:
setManagerData
in interfaceXBLManagerData
-