org.apache.batik.dom
Class AbstractElement

java.lang.Object
  extended by org.apache.batik.dom.AbstractNode
      extended by org.apache.batik.dom.AbstractParentNode
          extended by org.apache.batik.dom.AbstractParentChildNode
              extended by org.apache.batik.dom.AbstractElement
All Implemented Interfaces:
Serializable, NodeEventTarget, ExtendedNode, NodeXBL, XBLManagerData, Element, ElementTraversal, EventTarget, Node
Direct Known Subclasses:
AbstractElement, AbstractElementNS, GenericElement

public abstract class AbstractElement
extends AbstractParentChildNode
implements Element, ElementTraversal

This class implements the Element interface.

See Also:
Serialized Form

Nested Class Summary
 class AbstractElement.ElementTypeInfo
          Inner class to hold type information about this element.
protected static class AbstractElement.Entry
          To manage collisions in the attributes map.
 class AbstractElement.NamedNodeHashMap
          An implementation of the NamedNodeMap.
 
Nested classes/interfaces inherited from class org.apache.batik.dom.AbstractParentNode
AbstractParentNode.ChildNodes, AbstractParentNode.ElementsByTagName, AbstractParentNode.ElementsByTagNameNS
 
Field Summary
protected  NamedNodeMap attributes
          The attributes of this element.
protected  TypeInfo typeInfo
          The element type information.
 
Fields inherited from class org.apache.batik.dom.AbstractParentChildNode
nextSibling, parentNode, previousSibling
 
Fields inherited from class org.apache.batik.dom.AbstractParentNode
childNodes
 
Fields inherited from class org.apache.batik.dom.AbstractNode
DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, EMPTY_NODE_LIST, eventSupport, managerData, ownerDocument, userData, userDataHandlers
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
protected AbstractElement()
          Creates a new AbstractElement object.
protected AbstractElement(String name, AbstractDocument owner)
          Creates a new AbstractElement object.
 
Method Summary
protected  void attrAdded(Attr node, String newv)
          Called when an attribute has been added.
protected  void attrModified(Attr node, String oldv, String newv)
          Called when an attribute has been modified.
protected  void attrRemoved(Attr node, String oldv)
          Called when an attribute has been removed.
protected  void checkChildType(Node n, boolean replace)
          Checks the validity of a node to be inserted.
protected  Node copyInto(Node n)
          Copy the fields of the current node into the given node.
protected  NamedNodeMap createAttributes()
          Creates the attribute list.
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.
protected  Node export(Node n, AbstractDocument d)
          Exports this node to the given document.
 void fireDOMAttrModifiedEvent(String name, Attr node, String oldv, String newv, short change)
          Fires a DOMAttrModified event.
 String getAttribute(String name)
          DOM: Implements Element.getAttribute(String).
 Attr getAttributeNode(String name)
          DOM: Implements Element.getAttributeNode(String).
 Attr getAttributeNodeNS(String namespaceURI, String localName)
          DOM: Implements Element.getAttributeNodeNS(String,String).
 String getAttributeNS(String namespaceURI, String localName)
          DOM: Implements Element.getAttributeNS(String,String).
 NamedNodeMap getAttributes()
          DOM: Implements Node.getAttributes().
 int getChildElementCount()
          DOM: Implements ElementTraversal.getChildElementCount().
 Element getFirstElementChild()
          DOM: Implements ElementTraversal.getFirstElementChild().
protected  String getId()
          Get the ID of this element.
protected  Attr getIdAttribute()
          Get an ID attribute.
 Element getLastElementChild()
          DOM: Implements ElementTraversal.getLastElementChild().
 Element getNextElementSibling()
          DOM: Implements ElementTraversal.getNextElementSibling().
 short getNodeType()
          DOM: Implements Node.getNodeType().
 Element getPreviousElementSibling()
          DOM: Implements ElementTraversal.getPreviousElementSibling().
 TypeInfo getSchemaTypeInfo()
          DOM: Implements Element.getSchemaTypeInfo().
 String getTagName()
          DOM: Implements Element.getTagName().
 boolean hasAttribute(String name)
          DOM: Implements Element.hasAttribute(String).
 boolean hasAttributeNS(String namespaceURI, String localName)
          DOM: Implements Element.hasAttributeNS(String,String).
 boolean hasAttributes()
          DOM: Implements Node.hasAttributes().
protected  void nodeAdded(Node node)
          Called when a child node has been added.
protected  void nodeToBeRemoved(Node node)
          Called when a child node is going to be removed.
 void normalize()
          DOM: Implements Node.normalize().
 void removeAttribute(String name)
          DOM: Implements Element.removeAttribute(String).
 Attr removeAttributeNode(Attr oldAttr)
          DOM: Implements Element.removeAttributeNode(Attr).
 void removeAttributeNS(String namespaceURI, String localName)
          DOM: Implements Element.removeAttributeNS(String,String).
 void setAttribute(String name, String value)
          DOM: Implements Element.setAttribute(String,String).
 Attr setAttributeNode(Attr newAttr)
          DOM: Implements Element.setAttributeNode(Attr).
 Attr setAttributeNodeNS(Attr newAttr)
          DOM: Implements Element.setAttributeNodeNS(Attr).
 void setAttributeNS(String namespaceURI, String qualifiedName, String value)
          DOM: Implements Element.setAttributeNS(String,String,String).
 void setIdAttribute(String name, boolean isId)
          DOM: Implements Element.setIdAttribute(String,boolean).
 void setIdAttributeNode(Attr attr, boolean isId)
          DOM: Implements Element.setIdAttributeNode(Attr,boolean).
 void setIdAttributeNS(String ns, String ln, boolean isId)
          DOM: Implements Element.setIdAttributeNS(String,String,boolean).
 
Methods inherited from class org.apache.batik.dom.AbstractParentChildNode
getNextSibling, getParentNode, getPreviousSibling, setNextSibling, setParentNode, setPreviousSibling
 
Methods inherited from class org.apache.batik.dom.AbstractParentNode
appendChild, checkAndRemove, fireDOMNodeInsertedEvent, fireDOMNodeInsertedIntoDocumentEvent, fireDOMNodeRemovedEvent, fireDOMNodeRemovedFromDocumentEvent, fireDOMSubtreeModifiedEvent, getChildNodes, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getLastChild, getTextContent, hasChildNodes, insertBefore, removeChild, replaceChild
 
Methods inherited from class org.apache.batik.dom.AbstractNode
addEventListener, addEventListenerNS, cloneNode, compareDocumentPosition, compareNamedNodeMaps, compareStrings, createDOMException, dispatchEvent, fireDOMCharacterDataModifiedEvent, fireUserDataHandlers, getBaseURI, getBaseURI, getCascadedXMLBase, getCurrentDocument, getEventSupport, getFeature, getLocalName, getManagerData, getNamespaceURI, getNodeValue, getOwnerDocument, getParentNodeEventTarget, getPrefix, getUserData, getXblBoundElement, getXblChildNodes, getXblDefinitions, getXblFirstChild, getXblFirstElementChild, getXblLastChild, getXblLastElementChild, getXblNextElementSibling, getXblNextSibling, getXblParentNode, getXblPreviousElementSibling, getXblPreviousSibling, getXblScopedChildNodes, getXblShadowTree, hasEventListenerNS, initializeEventSupport, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespacePrefix, lookupNamespaceURI, lookupPrefix, newNode, removeEventListener, removeEventListenerNS, setManagerData, setNodeName, setNodeValue, setOwnerDocument, setPrefix, setSpecified, setTextContent, setUserData, willTriggerNS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Element
getElementsByTagName, getElementsByTagNameNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 
Methods inherited from interface org.apache.batik.dom.ExtendedNode
isReadonly, setReadonly
 

Field Detail

attributes

protected NamedNodeMap attributes
The attributes of this element.


typeInfo

protected TypeInfo typeInfo
The element type information.

Constructor Detail

AbstractElement

protected AbstractElement()
Creates a new AbstractElement object.


AbstractElement

protected AbstractElement(String name,
                          AbstractDocument owner)
Creates a new AbstractElement object.

Parameters:
name - The element name for validation purposes.
owner - The owner document.
Throws:
DOMException - INVALID_CHARACTER_ERR: if name contains invalid characters,
Method Detail

getNodeType

public short getNodeType()
DOM: Implements Node.getNodeType().

Specified by:
getNodeType in interface Node
Returns:
Node.ELEMENT_NODE

hasAttributes

public boolean hasAttributes()
DOM: Implements Node.hasAttributes().

Specified by:
hasAttributes in interface Node
Overrides:
hasAttributes in class AbstractNode
Returns:
false.

getAttributes

public NamedNodeMap getAttributes()
DOM: Implements Node.getAttributes().

Specified by:
getAttributes in interface Node
Overrides:
getAttributes in class AbstractNode
Returns:
null.

getTagName

public String getTagName()
DOM: Implements Element.getTagName().

Specified by:
getTagName in interface Element
Returns:
Node.getNodeName().

hasAttribute

public boolean hasAttribute(String name)
DOM: Implements Element.hasAttribute(String).

Specified by:
hasAttribute in interface Element

getAttribute

public String getAttribute(String name)
DOM: Implements Element.getAttribute(String).

Specified by:
getAttribute in interface Element

setAttribute

public void setAttribute(String name,
                         String value)
                  throws DOMException
DOM: Implements Element.setAttribute(String,String).

Specified by:
setAttribute in interface Element
Throws:
DOMException

removeAttribute

public void removeAttribute(String name)
                     throws DOMException
DOM: Implements Element.removeAttribute(String).

Specified by:
removeAttribute in interface Element
Throws:
DOMException

getAttributeNode

public Attr getAttributeNode(String name)
DOM: Implements Element.getAttributeNode(String).

Specified by:
getAttributeNode in interface Element

setAttributeNode

public Attr setAttributeNode(Attr newAttr)
                      throws DOMException
DOM: Implements Element.setAttributeNode(Attr).

Specified by:
setAttributeNode in interface Element
Throws:
DOMException

removeAttributeNode

public Attr removeAttributeNode(Attr oldAttr)
                         throws DOMException
DOM: Implements Element.removeAttributeNode(Attr).

Specified by:
removeAttributeNode in interface Element
Throws:
DOMException

normalize

public void normalize()
DOM: Implements Node.normalize().

Specified by:
normalize in interface Node
Overrides:
normalize in class AbstractParentNode

hasAttributeNS

public boolean hasAttributeNS(String namespaceURI,
                              String localName)
DOM: Implements Element.hasAttributeNS(String,String).

Specified by:
hasAttributeNS in interface Element

getAttributeNS

public String getAttributeNS(String namespaceURI,
                             String localName)
DOM: Implements Element.getAttributeNS(String,String).

Specified by:
getAttributeNS in interface Element

setAttributeNS

public void setAttributeNS(String namespaceURI,
                           String qualifiedName,
                           String value)
                    throws DOMException
DOM: Implements Element.setAttributeNS(String,String,String).

Specified by:
setAttributeNS in interface Element
Throws:
DOMException

removeAttributeNS

public void removeAttributeNS(String namespaceURI,
                              String localName)
                       throws DOMException
DOM: Implements Element.removeAttributeNS(String,String).

Specified by:
removeAttributeNS in interface Element
Throws:
DOMException

getAttributeNodeNS

public Attr getAttributeNodeNS(String namespaceURI,
                               String localName)
DOM: Implements Element.getAttributeNodeNS(String,String).

Specified by:
getAttributeNodeNS in interface Element

setAttributeNodeNS

public Attr setAttributeNodeNS(Attr newAttr)
                        throws DOMException
DOM: Implements Element.setAttributeNodeNS(Attr).

Specified by:
setAttributeNodeNS in interface Element
Throws:
DOMException

getSchemaTypeInfo

public TypeInfo getSchemaTypeInfo()
DOM: Implements Element.getSchemaTypeInfo().

Specified by:
getSchemaTypeInfo in interface Element

setIdAttribute

public void setIdAttribute(String name,
                           boolean isId)
                    throws DOMException
DOM: Implements Element.setIdAttribute(String,boolean).

Specified by:
setIdAttribute in interface Element
Throws:
DOMException

setIdAttributeNS

public void setIdAttributeNS(String ns,
                             String ln,
                             boolean isId)
                      throws DOMException
DOM: Implements Element.setIdAttributeNS(String,String,boolean).

Specified by:
setIdAttributeNS in interface Element
Throws:
DOMException

setIdAttributeNode

public void setIdAttributeNode(Attr attr,
                               boolean isId)
                        throws DOMException
DOM: Implements Element.setIdAttributeNode(Attr,boolean).

Specified by:
setIdAttributeNode in interface Element
Throws:
DOMException

getIdAttribute

protected Attr getIdAttribute()
Get an ID attribute.


getId

protected String getId()
Get the ID of this element.


nodeAdded

protected void nodeAdded(Node node)
Called when a child node has been added.

Overrides:
nodeAdded in class AbstractParentNode

nodeToBeRemoved

protected void nodeToBeRemoved(Node node)
Called when a child node is going to be removed.

Overrides:
nodeToBeRemoved in class AbstractParentNode

createAttributes

protected NamedNodeMap createAttributes()
Creates the attribute list.


export

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

Overrides:
export in class AbstractNode
Parameters:
n - The clone node.
d - The destination document.

deepExport

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

Overrides:
deepExport in class AbstractParentNode
Parameters:
n - The clone node.
d - The destination document.

copyInto

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

Overrides:
copyInto in class AbstractNode
Parameters:
n - a node of the type of this.

deepCopyInto

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

Overrides:
deepCopyInto in class AbstractParentNode
Parameters:
n - a node of the type of this.

checkChildType

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

Overrides:
checkChildType in class AbstractNode
Parameters:
n - The node to be inserted.

fireDOMAttrModifiedEvent

public void fireDOMAttrModifiedEvent(String name,
                                     Attr node,
                                     String oldv,
                                     String newv,
                                     short change)
Fires a DOMAttrModified event. WARNING: public accessor because of compilation problems on Solaris. Do not change.

Parameters:
name - The attribute's name.
node - The attribute's node.
oldv - The old value of the attribute.
newv - The new value of the attribute.
change - The modification type.

attrAdded

protected void attrAdded(Attr node,
                         String newv)
Called when an attribute has been added.


attrModified

protected void attrModified(Attr node,
                            String oldv,
                            String newv)
Called when an attribute has been modified.


attrRemoved

protected void attrRemoved(Attr node,
                           String oldv)
Called when an attribute has been removed.


getFirstElementChild

public Element getFirstElementChild()
DOM: Implements ElementTraversal.getFirstElementChild().

Specified by:
getFirstElementChild in interface ElementTraversal

getLastElementChild

public Element getLastElementChild()
DOM: Implements ElementTraversal.getLastElementChild().

Specified by:
getLastElementChild in interface ElementTraversal

getNextElementSibling

public Element getNextElementSibling()
DOM: Implements ElementTraversal.getNextElementSibling().

Specified by:
getNextElementSibling in interface ElementTraversal

getPreviousElementSibling

public Element getPreviousElementSibling()
DOM: Implements ElementTraversal.getPreviousElementSibling().

Specified by:
getPreviousElementSibling in interface ElementTraversal

getChildElementCount

public int getChildElementCount()
DOM: Implements ElementTraversal.getChildElementCount().

Specified by:
getChildElementCount in interface ElementTraversal


Copyright © 2008 Apache Software Foundation. All Rights Reserved.