org.apache.batik.dom

Class AbstractElement

public abstract class AbstractElement extends AbstractParentChildNode implements Element

This class implements the {@link org.w3c.dom.Element} interface.
Nested Class Summary
classAbstractElement.ElementTypeInfo
Inner class to hold type information about this element.
protected static classAbstractElement.Entry
To manage collisions in the attributes map.
classAbstractElement.NamedNodeHashMap
An implementation of the {@link org.w3c.dom.NamedNodeMap}.
Field Summary
protected NamedNodeMapattributes
The attributes of this element.
protected TypeInfotypeInfo
The element type information.
Constructor Summary
protected AbstractElement()
Creates a new AbstractElement object.
protected AbstractElement(String name, AbstractDocument owner)
Creates a new AbstractElement object.
Method Summary
protected voidattrAdded(Attr node, String newv)
Called when an attribute has been added.
protected voidattrModified(Attr node, String oldv, String newv)
Called when an attribute has been modified.
protected voidattrRemoved(Attr node, String oldv)
Called when an attribute has been removed.
protected voidcheckChildType(Node n, boolean replace)
Checks the validity of a node to be inserted.
protected NodecopyInto(Node n)
Copy the fields of the current node into the given node.
protected NamedNodeMapcreateAttributes()
Creates the attribute list.
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.
protected Nodeexport(Node n, AbstractDocument d)
Exports this node to the given document.
voidfireDOMAttrModifiedEvent(String name, Attr node, String oldv, String newv, short change)
Fires a DOMAttrModified event.
StringgetAttribute(String name)
DOM: Implements {@link org.w3c.dom.Element#getAttribute(String)}.
AttrgetAttributeNode(String name)
DOM: Implements {@link org.w3c.dom.Element#getAttributeNode(String)}.
AttrgetAttributeNodeNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.Element#getAttributeNodeNS(String,String)}.
StringgetAttributeNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.Element#getAttributeNS(String,String)}.
NamedNodeMapgetAttributes()
DOM: Implements {@link org.w3c.dom.Node#getAttributes()}.
protected StringgetId()
Get the ID of this element.
protected AttrgetIdAttribute()
Get an ID attribute.
shortgetNodeType()
DOM: Implements {@link org.w3c.dom.Node#getNodeType()}.
TypeInfogetSchemaTypeInfo()
DOM: Implements {@link org.w3c.dom.Element#getSchemaTypeInfo()}.
StringgetTagName()
DOM: Implements {@link org.w3c.dom.Element#getTagName()}.
booleanhasAttribute(String name)
DOM: Implements {@link org.w3c.dom.Element#hasAttribute(String)}.
booleanhasAttributeNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.Element#hasAttributeNS(String,String)}.
booleanhasAttributes()
DOM: Implements {@link org.w3c.dom.Node#hasAttributes()}.
protected voidnodeAdded(Node node)
Called when a child node has been added.
protected voidnodeToBeRemoved(Node node)
Called when a child node is going to be removed.
voidnormalize()
DOM: Implements {@link org.w3c.dom.Node#normalize()}.
voidremoveAttribute(String name)
DOM: Implements {@link org.w3c.dom.Element#removeAttribute(String)}.
AttrremoveAttributeNode(Attr oldAttr)
DOM: Implements {@link org.w3c.dom.Element#removeAttributeNode(Attr)}.
voidremoveAttributeNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.Element#removeAttributeNS(String,String)}.
voidsetAttribute(String name, String value)
DOM: Implements {@link org.w3c.dom.Element#setAttribute(String,String)}.
AttrsetAttributeNode(Attr newAttr)
DOM: Implements {@link org.w3c.dom.Element#setAttributeNode(Attr)}.
AttrsetAttributeNodeNS(Attr newAttr)
DOM: Implements {@link org.w3c.dom.Element#setAttributeNodeNS(Attr)}.
voidsetAttributeNS(String namespaceURI, String qualifiedName, String value)
DOM: Implements {@link org.w3c.dom.Element#setAttributeNS(String,String,String)}.
voidsetIdAttribute(String name, boolean isId)
DOM: Implements {@link org.w3c.dom.Element#setIdAttribute(String,boolean)}.
voidsetIdAttributeNode(Attr attr, boolean isId)
DOM: Implements {@link org.w3c.dom.Element#setIdAttributeNode(Attr,boolean)}.
voidsetIdAttributeNS(String ns, String ln, boolean isId)
DOM: Implements {@link org.w3c.dom.Element#setIdAttributeNS(String,String,boolean)}.

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

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.

checkChildType

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

Parameters: n The node to be inserted.

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.

createAttributes

protected NamedNodeMap createAttributes()
Creates the attribute list.

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.

Parameters: n The clone node. d The destination document.

export

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

Parameters: n The clone node. d The destination document.

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.

getAttribute

public String getAttribute(String name)
DOM: Implements {@link org.w3c.dom.Element#getAttribute(String)}.

getAttributeNode

public Attr getAttributeNode(String name)
DOM: Implements {@link org.w3c.dom.Element#getAttributeNode(String)}.

getAttributeNodeNS

public Attr getAttributeNodeNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.Element#getAttributeNodeNS(String,String)}.

getAttributeNS

public String getAttributeNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.Element#getAttributeNS(String,String)}.

getAttributes

public NamedNodeMap getAttributes()
DOM: Implements {@link org.w3c.dom.Node#getAttributes()}.

getId

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

getIdAttribute

protected Attr getIdAttribute()
Get an ID attribute.

getNodeType

public short getNodeType()
DOM: Implements {@link org.w3c.dom.Node#getNodeType()}.

Returns: {@link org.w3c.dom.Node#ELEMENT_NODE}

getSchemaTypeInfo

public TypeInfo getSchemaTypeInfo()
DOM: Implements {@link org.w3c.dom.Element#getSchemaTypeInfo()}.

getTagName

public String getTagName()
DOM: Implements {@link org.w3c.dom.Element#getTagName()}.

Returns: {@link #getNodeName()}.

hasAttribute

public boolean hasAttribute(String name)
DOM: Implements {@link org.w3c.dom.Element#hasAttribute(String)}.

hasAttributeNS

public boolean hasAttributeNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.Element#hasAttributeNS(String,String)}.

hasAttributes

public boolean hasAttributes()
DOM: Implements {@link org.w3c.dom.Node#hasAttributes()}.

nodeAdded

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

nodeToBeRemoved

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

normalize

public void normalize()
DOM: Implements {@link org.w3c.dom.Node#normalize()}.

removeAttribute

public void removeAttribute(String name)
DOM: Implements {@link org.w3c.dom.Element#removeAttribute(String)}.

removeAttributeNode

public Attr removeAttributeNode(Attr oldAttr)
DOM: Implements {@link org.w3c.dom.Element#removeAttributeNode(Attr)}.

removeAttributeNS

public void removeAttributeNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.Element#removeAttributeNS(String,String)}.

setAttribute

public void setAttribute(String name, String value)
DOM: Implements {@link org.w3c.dom.Element#setAttribute(String,String)}.

setAttributeNode

public Attr setAttributeNode(Attr newAttr)
DOM: Implements {@link org.w3c.dom.Element#setAttributeNode(Attr)}.

setAttributeNodeNS

public Attr setAttributeNodeNS(Attr newAttr)
DOM: Implements {@link org.w3c.dom.Element#setAttributeNodeNS(Attr)}.

setAttributeNS

public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
DOM: Implements {@link org.w3c.dom.Element#setAttributeNS(String,String,String)}.

setIdAttribute

public void setIdAttribute(String name, boolean isId)
DOM: Implements {@link org.w3c.dom.Element#setIdAttribute(String,boolean)}.

setIdAttributeNode

public void setIdAttributeNode(Attr attr, boolean isId)
DOM: Implements {@link org.w3c.dom.Element#setIdAttributeNode(Attr,boolean)}.

setIdAttributeNS

public void setIdAttributeNS(String ns, String ln, boolean isId)
DOM: Implements {@link org.w3c.dom.Element#setIdAttributeNS(String,String,boolean)}.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.