org.apache.batik.dom

Class AbstractNode

public abstract class AbstractNode extends Object implements ExtendedNode, NodeXBL, XBLManagerData, Serializable

This class implements the org.w3c.dom.Node interface.
Field Summary
static shortDOCUMENT_POSITION_CONTAINED_BY
static shortDOCUMENT_POSITION_CONTAINS
static shortDOCUMENT_POSITION_DISCONNECTED
static shortDOCUMENT_POSITION_FOLLOWING
static shortDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
static shortDOCUMENT_POSITION_PRECEDING
protected EventSupporteventSupport
The event support.
static NodeListEMPTY_NODE_LIST
An empty instance of NodeList.
protected ObjectmanagerData
The XBL manager data.
protected AbstractDocumentownerDocument
The owner document.
protected HashMapuserData
User data.
protected HashMapuserDataHandlers
User data handlers.
Method Summary
voidaddEventListener(String type, EventListener listener, boolean useCapture)
DOM: Implements EventTarget.
voidaddEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture, Object evtGroup)
DOM: Implements NodeEventTarget.
NodeappendChild(Node newChild)
DOM: Implements org.w3c.dom.Node#appendChild(Node).
protected voidcheckChildType(Node n, boolean replace)
Checks the validity of a node to be inserted.
NodecloneNode(boolean deep)
DOM: Implements org.w3c.dom.Node#cloneNode(boolean).
shortcompareDocumentPosition(Node other)
DOM: Implements org.w3c.dom.Node#compareDocumentPosition(Node).
protected booleancompareNamedNodeMaps(NamedNodeMap nnm1, NamedNodeMap nnm2)
Compare two NamedNodeMaps for equality.
protected booleancompareStrings(String s1, String s2)
Compare two strings for equality.
protected NodecopyInto(Node n)
Copy the fields of the current node into the given node.
DOMExceptioncreateDOMException(short type, String key, Object[] args)
Creates an exception with the appropriate error message.
protected NodedeepCopyInto(Node n)
Deeply copy the fields of the current node into the given node.
protected NodedeepExport(Node n, AbstractDocument d)
Deeply exports this node to the given document.
booleandispatchEvent(Event evt)
DOM: Implements dispatchEvent.
protected Nodeexport(Node n, AbstractDocument d)
Exports this node to the given document.
protected voidfireDOMCharacterDataModifiedEvent(String oldv, String newv)
Fires a DOMCharacterDataModified event.
voidfireDOMNodeInsertedIntoDocumentEvent()
Recursively fires a DOMNodeInsertedIntoDocument event.
voidfireDOMNodeRemovedFromDocumentEvent()
Recursively fires a DOMNodeRemovedFromDocument event.
protected voidfireUserDataHandlers(short type, Node oldNode, Node newNode)
Fire any UserDataHandlers on the given oldNode.
NamedNodeMapgetAttributes()
DOM: Implements org.w3c.dom.Node#getAttributes().
StringgetBaseURI()
DOM: Implements org.w3c.dom.Node#getBaseURI().
static StringgetBaseURI(Node n)
protected StringgetCascadedXMLBase(Node node)
Returns the xml:base attribute value of the given element, resolving any dependency on parent bases if needed.
NodeListgetChildNodes()
DOM: Implements org.w3c.dom.Node#getChildNodes().
protected AbstractDocumentgetCurrentDocument()
Returns the current document.
EventSupportgetEventSupport()
Returns the event support instance for this node, or null if any.
ObjectgetFeature(String feature, String version)
DOM: Implements org.w3c.dom.Node#getFeature(String,String).
NodegetFirstChild()
DOM: Implements org.w3c.dom.Node#getFirstChild().
NodegetLastChild()
DOM: Implements org.w3c.dom.Node#getLastChild().
StringgetLocalName()
DOM: Implements org.w3c.dom.Node#getLocalName().
ObjectgetManagerData()
Returns the XBL manager associated data for this node.
StringgetNamespaceURI()
DOM: Implements org.w3c.dom.Node#getNamespaceURI().
NodegetNextSibling()
DOM: Implements org.w3c.dom.Node#getNextSibling().
StringgetNodeValue()
DOM: Implements org.w3c.dom.Node#getNodeValue().
DocumentgetOwnerDocument()
DOM: Implements org.w3c.dom.Node#getOwnerDocument().
NodegetParentNode()
DOM: Implements org.w3c.dom.Node#getParentNode().
NodeEventTargetgetParentNodeEventTarget()
StringgetPrefix()
DOM: Implements org.w3c.dom.Node#getPrefix().
NodegetPreviousSibling()
DOM: Implements org.w3c.dom.Node#getPreviousSibling().
StringgetTextContent()
DOM: Implements org.w3c.dom.Node#getTextContent().
ObjectgetUserData(String key)
DOM: Implements org.w3c.dom.Node#getUserData(String).
ElementgetXblBoundElement()
Get the bound element whose shadow tree this current node resides in.
NodeListgetXblChildNodes()
Get the list of child nodes of this node in the fully flattened tree.
NodeListgetXblDefinitions()
Get the xbl:definition elements currently binding this element.
NodegetXblFirstChild()
Get the first child node of this node in the fully flattened tree.
ElementgetXblFirstElementChild()
Get the first element child of this node in the fully flattened tree.
NodegetXblLastChild()
Get the last child node of this node in the fully flattened tree.
ElementgetXblLastElementChild()
Get the last element child of this node in the fully flattened tree.
ElementgetXblNextElementSibling()
Get the first element that follows the current node in the xblParentNode's xblChildNodes list.
NodegetXblNextSibling()
Get the node which directly follows the current node in the xblParentNode's xblChildNodes list.
NodegetXblParentNode()
Get the parent of this node in the fully flattened tree.
ElementgetXblPreviousElementSibling()
Get the first element that precedes the current node in the xblParentNode's xblChildNodes list.
NodegetXblPreviousSibling()
Get the node which directly precedes the current node in the xblParentNode's xblChildNodes list.
NodeListgetXblScopedChildNodes()
Get the list of child nodes of this node in the fully flattened tree that are within the same shadow scope.
ElementgetXblShadowTree()
Get the shadow tree of this node.
booleanhasAttributes()
DOM: Implements org.w3c.dom.Node#hasAttributes().
booleanhasChildNodes()
DOM: Implements org.w3c.dom.Node#hasChildNodes().
booleanhasEventListenerNS(String namespaceURI, String type)
DOM: Implements EventTarget.hasEventListenerNS(String,String) from an old draft of DOM Level 3 Events.
EventSupportinitializeEventSupport()
Initializes the event support instance for this node if it has not been already, and returns it.
NodeinsertBefore(Node newChild, Node refChild)
DOM: Implements org.w3c.dom.Node#insertBefore(Node, Node).
booleanisDefaultNamespace(String namespaceURI)
DOM: Implements org.w3c.dom.Node#isDefaultNamespace(String).
booleanisEqualNode(Node other)
DOM: Implements org.w3c.dom.Node#isEqualNode(Node).
booleanisSameNode(Node other)
DOM: Implements org.w3c.dom.Node#isSameNode(Node).
booleanisSupported(String feature, String version)
DOM: Implements org.w3c.dom.Node#isSupported(String,String).
protected StringlookupNamespacePrefix(String namespaceURI, Element originalElement)
Helper function for AbstractNode.
StringlookupNamespaceURI(String prefix)
DOM: Implements org.w3c.dom.Node#lookupNamespaceURI(String).
StringlookupPrefix(String namespaceURI)
DOM: Implements org.w3c.dom.Node#lookupPrefix(String).
protected abstract NodenewNode()
Returns a new uninitialized instance of this object's class.
voidnormalize()
DOM: Implements org.w3c.dom.Node#normalize().
NoderemoveChild(Node oldChild)
DOM: Implements org.w3c.dom.Node#removeChild(Node).
voidremoveEventListener(String type, EventListener listener, boolean useCapture)
DOM: Implements EventTarget.
voidremoveEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture)
DOM: Implements NodeEventTarget.
NodereplaceChild(Node newChild, Node oldChild)
DOM: Implements org.w3c.dom.Node#replaceChild(Node, Node).
voidsetManagerData(Object data)
Sets the XBL manager associated data for this node.
voidsetNextSibling(Node n)
Sets the node immediately following this node.
voidsetNodeName(String v)
Sets the name of this node.
voidsetNodeValue(String nodeValue)
DOM: Implements org.w3c.dom.Node#setNodeValue(String).
voidsetOwnerDocument(Document doc)
Sets the owner document of this node.
voidsetParentNode(Node v)
Sets the parent node.
voidsetPrefix(String prefix)
DOM: Implements org.w3c.dom.Node#setPrefix(String).
voidsetPreviousSibling(Node n)
Sets the node immediately preceding this node.
voidsetSpecified(boolean v)
Sets the value of the specified attribute.
voidsetTextContent(String s)
DOM: Implements org.w3c.dom.Node#setTextContent(String).
ObjectsetUserData(String key, Object data, UserDataHandler handler)
DOM: Implements org.w3c.dom.Node#setUserData(String,Object,UserDataHandler).
booleanwillTriggerNS(String namespaceURI, String type)
DOM: Implements EventTarget#willTriggerNS(String,String) from an old draft of DOM Level 3 Events.

Field Detail

DOCUMENT_POSITION_CONTAINED_BY

public static final short DOCUMENT_POSITION_CONTAINED_BY

DOCUMENT_POSITION_CONTAINS

public static final short DOCUMENT_POSITION_CONTAINS

DOCUMENT_POSITION_DISCONNECTED

public static final short DOCUMENT_POSITION_DISCONNECTED

DOCUMENT_POSITION_FOLLOWING

public static final short DOCUMENT_POSITION_FOLLOWING

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

DOCUMENT_POSITION_PRECEDING

public static final short DOCUMENT_POSITION_PRECEDING

eventSupport

protected transient EventSupport eventSupport
The event support.

EMPTY_NODE_LIST

public static final NodeList EMPTY_NODE_LIST
An empty instance of NodeList.

managerData

protected Object managerData
The XBL manager data.

ownerDocument

protected AbstractDocument ownerDocument
The owner document.

userData

protected HashMap userData
User data.

userDataHandlers

protected HashMap userDataHandlers
User data handlers.

Method Detail

addEventListener

public void addEventListener(String type, EventListener listener, boolean useCapture)
DOM: Implements EventTarget.

addEventListenerNS

public void addEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture, Object evtGroup)
DOM: Implements NodeEventTarget.

appendChild

public Node appendChild(Node newChild)
DOM: Implements org.w3c.dom.Node#appendChild(Node). Throws a HIERARCHY_REQUEST_ERR org.w3c.dom.DOMException.

checkChildType

protected void checkChildType(Node n, boolean replace)
Checks the validity of a node to be inserted.

cloneNode

public Node cloneNode(boolean deep)
DOM: Implements org.w3c.dom.Node#cloneNode(boolean).

compareDocumentPosition

public short compareDocumentPosition(Node other)
DOM: Implements org.w3c.dom.Node#compareDocumentPosition(Node). XXX Doesn't handle notation or entity nodes.

compareNamedNodeMaps

protected boolean compareNamedNodeMaps(NamedNodeMap nnm1, NamedNodeMap nnm2)
Compare two NamedNodeMaps for equality.

compareStrings

protected boolean compareStrings(String s1, String s2)
Compare two strings for equality.

copyInto

protected Node copyInto(Node n)
Copy the fields of the current node into the given node.

Parameters: n a node of the type of this.

createDOMException

public DOMException createDOMException(short type, String key, Object[] args)
Creates an exception with the appropriate error message.

deepCopyInto

protected Node deepCopyInto(Node n)
Deeply copy the fields of the current node into the given node.

Parameters: n a node of the type of this.

deepExport

protected Node deepExport(Node n, AbstractDocument d)
Deeply exports this node to the given document.

dispatchEvent

public boolean dispatchEvent(Event evt)
DOM: Implements dispatchEvent.

export

protected Node export(Node n, AbstractDocument d)
Exports this node to the given document.

fireDOMCharacterDataModifiedEvent

protected void fireDOMCharacterDataModifiedEvent(String oldv, String newv)
Fires a DOMCharacterDataModified event.

fireDOMNodeInsertedIntoDocumentEvent

public void fireDOMNodeInsertedIntoDocumentEvent()
Recursively fires a DOMNodeInsertedIntoDocument event.

fireDOMNodeRemovedFromDocumentEvent

public void fireDOMNodeRemovedFromDocumentEvent()
Recursively fires a DOMNodeRemovedFromDocument event.

fireUserDataHandlers

protected void fireUserDataHandlers(short type, Node oldNode, Node newNode)
Fire any UserDataHandlers on the given oldNode.

getAttributes

public NamedNodeMap getAttributes()
DOM: Implements org.w3c.dom.Node#getAttributes().

Returns: null.

getBaseURI

public String getBaseURI()
DOM: Implements org.w3c.dom.Node#getBaseURI().

getBaseURI

public static String getBaseURI(Node n)

getCascadedXMLBase

protected String getCascadedXMLBase(Node node)
Returns the xml:base attribute value of the given element, resolving any dependency on parent bases if needed.

getChildNodes

public NodeList getChildNodes()
DOM: Implements org.w3c.dom.Node#getChildNodes().

Returns: EMPTY_NODE_LIST.

getCurrentDocument

protected AbstractDocument getCurrentDocument()
Returns the current document.

getEventSupport

public EventSupport getEventSupport()
Returns the event support instance for this node, or null if any.

getFeature

public Object getFeature(String feature, String version)
DOM: Implements org.w3c.dom.Node#getFeature(String,String).

getFirstChild

public Node getFirstChild()
DOM: Implements org.w3c.dom.Node#getFirstChild().

Returns: null.

getLastChild

public Node getLastChild()
DOM: Implements org.w3c.dom.Node#getLastChild().

Returns: null.

getLocalName

public String getLocalName()
DOM: Implements org.w3c.dom.Node#getLocalName().

getManagerData

public Object getManagerData()
Returns the XBL manager associated data for this node.

getNamespaceURI

public String getNamespaceURI()
DOM: Implements org.w3c.dom.Node#getNamespaceURI().

Returns: null.

getNextSibling

public Node getNextSibling()
DOM: Implements org.w3c.dom.Node#getNextSibling().

Returns: null.

getNodeValue

public String getNodeValue()
DOM: Implements org.w3c.dom.Node#getNodeValue().

Returns: null.

getOwnerDocument

public Document getOwnerDocument()
DOM: Implements org.w3c.dom.Node#getOwnerDocument().

Returns: ownerDocument.

getParentNode

public Node getParentNode()
DOM: Implements org.w3c.dom.Node#getParentNode().

Returns: null.

getParentNodeEventTarget

public NodeEventTarget getParentNodeEventTarget()
Implements getParentNodeEventTarget.

getPrefix

public String getPrefix()
DOM: Implements org.w3c.dom.Node#getPrefix().

getPreviousSibling

public Node getPreviousSibling()
DOM: Implements org.w3c.dom.Node#getPreviousSibling().

Returns: null.

getTextContent

public String getTextContent()
DOM: Implements org.w3c.dom.Node#getTextContent().

getUserData

public Object getUserData(String key)
DOM: Implements org.w3c.dom.Node#getUserData(String).

getXblBoundElement

public Element getXblBoundElement()
Get the bound element whose shadow tree this current node resides in.

getXblChildNodes

public NodeList getXblChildNodes()
Get the list of child nodes of this node in the fully flattened tree.

getXblDefinitions

public NodeList getXblDefinitions()
Get the xbl:definition elements currently binding this element.

getXblFirstChild

public Node getXblFirstChild()
Get the first child node of this node in the fully flattened tree.

getXblFirstElementChild

public Element getXblFirstElementChild()
Get the first element child of this node in the fully flattened tree.

getXblLastChild

public Node getXblLastChild()
Get the last child node of this node in the fully flattened tree.

getXblLastElementChild

public Element getXblLastElementChild()
Get the last element child of this node in the fully flattened tree.

getXblNextElementSibling

public Element getXblNextElementSibling()
Get the first element that follows the current node in the xblParentNode's xblChildNodes list.

getXblNextSibling

public Node getXblNextSibling()
Get the node which directly follows the current node in the xblParentNode's xblChildNodes list.

getXblParentNode

public Node getXblParentNode()
Get the parent of this node in the fully flattened tree.

getXblPreviousElementSibling

public Element getXblPreviousElementSibling()
Get the first element that precedes the current node in the xblParentNode's xblChildNodes list.

getXblPreviousSibling

public Node getXblPreviousSibling()
Get the node which directly precedes the current node in the xblParentNode's xblChildNodes list.

getXblScopedChildNodes

public NodeList getXblScopedChildNodes()
Get the list of child nodes of this node in the fully flattened tree that are within the same shadow scope.

getXblShadowTree

public Element getXblShadowTree()
Get the shadow tree of this node.

hasAttributes

public boolean hasAttributes()
DOM: Implements org.w3c.dom.Node#hasAttributes().

Returns: false.

hasChildNodes

public boolean hasChildNodes()
DOM: Implements org.w3c.dom.Node#hasChildNodes().

Returns: false.

hasEventListenerNS

public boolean hasEventListenerNS(String namespaceURI, String type)
DOM: Implements EventTarget.hasEventListenerNS(String,String) from an old draft of DOM Level 3 Events.

initializeEventSupport

public EventSupport initializeEventSupport()
Initializes the event support instance for this node if it has not been already, and returns it.

insertBefore

public Node insertBefore(Node newChild, Node refChild)
DOM: Implements org.w3c.dom.Node#insertBefore(Node, Node). Throws a HIERARCHY_REQUEST_ERR org.w3c.dom.DOMException.

isDefaultNamespace

public boolean isDefaultNamespace(String namespaceURI)
DOM: Implements org.w3c.dom.Node#isDefaultNamespace(String).

isEqualNode

public boolean isEqualNode(Node other)
DOM: Implements org.w3c.dom.Node#isEqualNode(Node).

isSameNode

public boolean isSameNode(Node other)
DOM: Implements org.w3c.dom.Node#isSameNode(Node).

isSupported

public boolean isSupported(String feature, String version)
DOM: Implements org.w3c.dom.Node#isSupported(String,String).

lookupNamespacePrefix

protected String lookupNamespacePrefix(String namespaceURI, Element originalElement)
Helper function for AbstractNode.

lookupNamespaceURI

public String lookupNamespaceURI(String prefix)
DOM: Implements org.w3c.dom.Node#lookupNamespaceURI(String).

lookupPrefix

public String lookupPrefix(String namespaceURI)
DOM: Implements org.w3c.dom.Node#lookupPrefix(String).

newNode

protected abstract Node newNode()
Returns a new uninitialized instance of this object's class.

normalize

public void normalize()
DOM: Implements org.w3c.dom.Node#normalize(). Do nothing.

removeChild

public Node removeChild(Node oldChild)
DOM: Implements org.w3c.dom.Node#removeChild(Node). Throws a HIERARCHY_REQUEST_ERR org.w3c.dom.DOMException.

removeEventListener

public void removeEventListener(String type, EventListener listener, boolean useCapture)
DOM: Implements EventTarget.

removeEventListenerNS

public void removeEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture)
DOM: Implements NodeEventTarget.

replaceChild

public Node replaceChild(Node newChild, Node oldChild)
DOM: Implements org.w3c.dom.Node#replaceChild(Node, Node). Throws a HIERARCHY_REQUEST_ERR org.w3c.dom.DOMException.

setManagerData

public void setManagerData(Object data)
Sets the XBL manager associated data for this node.

setNextSibling

public void setNextSibling(Node n)
Sets the node immediately following this node. Throws a HIERARCHY_REQUEST_ERR org.w3c.dom.DOMException.

setNodeName

public void setNodeName(String v)
Sets the name of this node. Do nothing.

setNodeValue

public void setNodeValue(String nodeValue)
DOM: Implements org.w3c.dom.Node#setNodeValue(String). Do nothing.

setOwnerDocument

public void setOwnerDocument(Document doc)
Sets the owner document of this node.

setParentNode

public void setParentNode(Node v)
Sets the parent node. Throws a HIERARCHY_REQUEST_ERR org.w3c.dom.DOMException.

setPrefix

public void setPrefix(String prefix)
DOM: Implements org.w3c.dom.Node#setPrefix(String).

setPreviousSibling

public void setPreviousSibling(Node n)
Sets the node immediately preceding this node. Throws a HIERARCHY_REQUEST_ERR org.w3c.dom.DOMException.

setSpecified

public void setSpecified(boolean v)
Sets the value of the specified attribute. This method only applies to Attr objects.

setTextContent

public void setTextContent(String s)
DOM: Implements org.w3c.dom.Node#setTextContent(String).

setUserData

public Object setUserData(String key, Object data, UserDataHandler handler)
DOM: Implements org.w3c.dom.Node#setUserData(String,Object,UserDataHandler).

willTriggerNS

public boolean willTriggerNS(String namespaceURI, String type)
DOM: Implements EventTarget#willTriggerNS(String,String) from an old draft of DOM Level 3 Events.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.