org.apache.batik.dom.svg
Class AbstractElement

java.lang.Object
  |
  +--org.apache.batik.dom.AbstractNode
        |
        +--org.apache.batik.dom.AbstractParentNode
              |
              +--org.apache.batik.dom.AbstractParentChildNode
                    |
                    +--org.apache.batik.dom.AbstractElement
                          |
                          +--org.apache.batik.dom.svg.AbstractElement
All Implemented Interfaces:
Element, ElementWithBaseURI, ElementWithID, ElementWithPseudoClass, EventTarget, ExtendedNode, HiddenChildElement, Node, NodeEventTarget, java.io.Serializable
Direct Known Subclasses:
ExtensionElement, SVGOMElement

public abstract class AbstractElement
extends AbstractElement
implements ElementWithBaseURI, ElementWithID, ElementWithPseudoClass, HiddenChildElement

This class provides a superclass to implement an SVG element, or an element interoperable with the SVG elements.

See Also:
Serialized Form

Inner Class Summary
protected  class AbstractElement.ExtendedNamedNodeHashMap
          An implementation of the NamedNodeMap.
 
Inner classes inherited from class org.apache.batik.dom.AbstractElement
AbstractElement.Entry, AbstractElement.NamedNodeHashMap
 
Inner classes inherited from class org.apache.batik.dom.AbstractParentNode
AbstractParentNode.ChildNodes, AbstractParentNode.ElementsByTagName
 
Field Summary
protected  SoftDoublyIndexedTable liveAttributeValues
          The live attribute values.
protected  Element parentElement
          The parent element.
protected  CSSOMReadOnlyStyleDeclaration styleDeclaration
          The cascaded style, if any.
 
Fields inherited from class org.apache.batik.dom.AbstractElement
attributes
 
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
EMPTY_NODE_LIST, eventSupport, ownerDocument
 
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
protected AbstractElement()
          Creates a new Element object.
protected AbstractElement(java.lang.String prefix, AbstractDocument owner)
          Creates a new Element object.
 
Method Summary
protected  void attrAdded(Attr node, java.lang.String newv)
          Called when an attribute has been added.
protected  void attrModified(Attr node, java.lang.String oldv, java.lang.String newv)
          Called when an attribute has been modified.
protected  void attrRemoved(Attr node, java.lang.String oldv)
          Called when an attribute has been removed.
protected  NamedNodeMap createAttributes()
          Creates the attribute list.
protected  AttributeInitializer getAttributeInitializer()
          Returns the AttributeInitializer for this element type.
 java.lang.String getBaseURI()
          Returns this element's base URI.
 java.lang.String getID()
          Returns the ID of this element or the empty string.
 LiveAttributeValue getLiveAttributeValue(java.lang.String ns, java.lang.String ln)
          Returns the live attribute value associated with given attribute, if any.
 Element getParentElement()
          The parent element of this element.
 NodeEventTarget getParentNodeEventTarget()
          Implements NodeEventTarget.getParentNodeEventTarget().
 CSSOMReadOnlyStyleDeclaration getStyleDeclaration()
          Gets the style of this element.
protected  void initializeAttributes()
          Initializes the attributes of this element to their default value.
 boolean matchPseudoClass(java.lang.String pseudoClass)
          Whether this element matches the given pseudo-class.
 void putLiveAttributeValue(java.lang.String ns, java.lang.String ln, LiveAttributeValue val)
          Associates a live attribute value to this element.
protected  boolean resetAttribute(java.lang.String ns, java.lang.String prefix, java.lang.String ln)
          Resets an attribute to the default value.
 void setIDName(java.lang.String uri, java.lang.String s)
          Sets the element ID attribute name.
 void setParentElement(Element elt)
          Sets the parent element.
 void setStyleDeclaration(CSSOMReadOnlyStyleDeclaration sd)
          Sets the style of this element.
 void setUnspecifiedAttribute(java.lang.String nsURI, java.lang.String name, java.lang.String value)
          Sets an unspecified attribute.
 
Methods inherited from class org.apache.batik.dom.AbstractElement
checkChildType, copyInto, deepCopyInto, deepExport, export, fireDOMAttrModifiedEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getNodeType, getTagName, hasAttribute, hasAttributeNS, hasAttributes, nodeAdded, nodeToBeRemoved, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 
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, hasChildNodes, insertBefore, removeChild, replaceChild
 
Methods inherited from class org.apache.batik.dom.AbstractNode
addEventListener, cloneNode, createDOMException, dispatchEvent, fireDOMCharacterDataModifiedEvent, getCurrentDocument, getEventSupport, getLocalName, getNamespaceURI, getNodeValue, getOwnerDocument, getPrefix, isSupported, newNode, removeEventListener, setNodeName, setNodeValue, setOwnerDocument, setPrefix, setSpecified
 
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, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, insertBefore, isSupported, removeChild, replaceChild, setNodeValue, setPrefix
 
Methods inherited from interface org.apache.batik.dom.ExtendedNode
isReadonly, setReadonly
 

Field Detail

parentElement

protected transient Element parentElement
The parent element.

liveAttributeValues

protected transient SoftDoublyIndexedTable liveAttributeValues
The live attribute values.

styleDeclaration

protected transient CSSOMReadOnlyStyleDeclaration styleDeclaration
The cascaded style, if any.
Constructor Detail

AbstractElement

protected AbstractElement()
Creates a new Element object.

AbstractElement

protected AbstractElement(java.lang.String prefix,
                          AbstractDocument owner)
Creates a new Element object.
Parameters:
prefix - The namespace prefix.
owner - The owner document.
Method Detail

getBaseURI

public java.lang.String getBaseURI()
Returns this element's base URI.
Specified by:
getBaseURI in interface ElementWithBaseURI

setIDName

public void setIDName(java.lang.String uri,
                      java.lang.String s)
Sets the element ID attribute name.
Specified by:
setIDName in interface ElementWithID
Parameters:
uri - The namespace uri.
s - The attribute local name.

getID

public java.lang.String getID()
Returns the ID of this element or the empty string.
Specified by:
getID in interface ElementWithID

matchPseudoClass

public boolean matchPseudoClass(java.lang.String pseudoClass)
Whether this element matches the given pseudo-class. This methods supports the :first-child pseudo class.
Specified by:
matchPseudoClass in interface ElementWithPseudoClass

getParentElement

public Element getParentElement()
The parent element of this element.
Specified by:
getParentElement in interface HiddenChildElement

setParentElement

public void setParentElement(Element elt)
Sets the parent element.
Specified by:
setParentElement in interface HiddenChildElement

getStyleDeclaration

public CSSOMReadOnlyStyleDeclaration getStyleDeclaration()
Gets the style of this element.
Specified by:
getStyleDeclaration in interface HiddenChildElement

setStyleDeclaration

public void setStyleDeclaration(CSSOMReadOnlyStyleDeclaration sd)
Sets the style of this element.
Specified by:
setStyleDeclaration in interface HiddenChildElement

getParentNodeEventTarget

public NodeEventTarget getParentNodeEventTarget()
Implements NodeEventTarget.getParentNodeEventTarget().
Overrides:
getParentNodeEventTarget in class AbstractNode

getLiveAttributeValue

public LiveAttributeValue getLiveAttributeValue(java.lang.String ns,
                                                java.lang.String ln)
Returns the live attribute value associated with given attribute, if any.
Parameters:
ns - The attribute's namespace.
ln - The attribute's local name.

putLiveAttributeValue

public void putLiveAttributeValue(java.lang.String ns,
                                  java.lang.String ln,
                                  LiveAttributeValue val)
Associates a live attribute value to this element.
Parameters:
ns - The attribute's namespace.
ln - The attribute's local name.
val - The live value.

getAttributeInitializer

protected AttributeInitializer getAttributeInitializer()
Returns the AttributeInitializer for this element type.
Returns:
null if this element has no attribute with a default value.

initializeAttributes

protected void initializeAttributes()
Initializes the attributes of this element to their default value.

resetAttribute

protected boolean resetAttribute(java.lang.String ns,
                                 java.lang.String prefix,
                                 java.lang.String ln)
Resets an attribute to the default value.
Returns:
true if a default value is known for the given attribute.

createAttributes

protected NamedNodeMap createAttributes()
Creates the attribute list.
Overrides:
createAttributes in class AbstractElement

setUnspecifiedAttribute

public void setUnspecifiedAttribute(java.lang.String nsURI,
                                    java.lang.String name,
                                    java.lang.String value)
Sets an unspecified attribute.
Parameters:
nsURI - The attribute namespace URI.
name - The attribute's qualified name.
value - The attribute's default value.

attrAdded

protected void attrAdded(Attr node,
                         java.lang.String newv)
Called when an attribute has been added.
Overrides:
attrAdded in class AbstractElement

attrModified

protected void attrModified(Attr node,
                            java.lang.String oldv,
                            java.lang.String newv)
Called when an attribute has been modified.
Overrides:
attrModified in class AbstractElement

attrRemoved

protected void attrRemoved(Attr node,
                           java.lang.String oldv)
Called when an attribute has been removed.
Overrides:
attrRemoved in class AbstractElement


Copyright © 2001 Apache Software Foundation. All Rights Reserved.