org.apache.batik.dom

Class AbstractAttr

public abstract class AbstractAttr extends AbstractParentNode implements Attr

This class implements the {@link org.w3c.dom.Attr} interface.
Nested Class Summary
classAbstractAttr.AttrTypeInfo
Inner class to hold type information about this attribute.
Field Summary
protected booleanisIdAttr
Whether this attribute is an ID attribute
protected StringnodeName
The name of this node.
protected AbstractElementownerElement
The owner element.
protected TypeInfotypeInfo
The attribute type information.
protected booleanunspecified
Whether this attribute was not specified in the original document.
Constructor Summary
protected AbstractAttr()
Creates a new Attr object.
protected AbstractAttr(String name, AbstractDocument owner)
Creates a new Attr object.
Method Summary
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 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.
protected voidfireDOMSubtreeModifiedEvent()
Fires a DOMSubtreeModified event.
StringgetName()
DOM: Implements {@link org.w3c.dom.Attr#getName()}.
StringgetNodeName()
DOM: Implements {@link org.w3c.dom.Node#getNodeName()}.
shortgetNodeType()
DOM: Implements {@link org.w3c.dom.Node#getNodeType()}.
StringgetNodeValue()
DOM: Implements {@link org.w3c.dom.Node#getNodeValue()}.
ElementgetOwnerElement()
DOM: Implements {@link org.w3c.dom.Attr#getOwnerElement()}.
TypeInfogetSchemaTypeInfo()
DOM: Implements {@link org.w3c.dom.Attr#getSchemaTypeInfo()}.
booleangetSpecified()
DOM: Implements {@link org.w3c.dom.Attr#getSpecified()}.
StringgetValue()
DOM: Implements {@link org.w3c.dom.Attr#getValue()}.
booleanisId()
DOM: Implements {@link org.w3c.dom.Attr#isId()}.
protected voidnodeAdded(Node n)
Called when a child node has been added.
protected voidnodeToBeRemoved(Node n)
Called when a child node is going to be removed.
voidsetIsId(boolean isId)
Sets whether this attribute is an ID attribute.
voidsetNodeName(String v)
Sets the node name.
voidsetNodeValue(String nodeValue)
DOM: Implements {@link org.w3c.dom.Node#setNodeValue(String)}.
voidsetOwnerElement(AbstractElement v)
Sets the owner element.
voidsetSpecified(boolean v)
Sets the specified attribute.
voidsetValue(String value)
DOM: Implements {@link org.w3c.dom.Attr#setValue(String)}.

Field Detail

isIdAttr

protected boolean isIdAttr
Whether this attribute is an ID attribute

nodeName

protected String nodeName
The name of this node.

ownerElement

protected AbstractElement ownerElement
The owner element.

typeInfo

protected TypeInfo typeInfo
The attribute type information.

unspecified

protected boolean unspecified
Whether this attribute was not specified in the original document.

Constructor Detail

AbstractAttr

protected AbstractAttr()
Creates a new Attr object.

AbstractAttr

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

Parameters: name The attribute name for validation purposes. owner The owner document.

Throws: DOMException INVALID_CHARACTER_ERR: if name contains invalid characters,

Method Detail

checkChildType

protected void checkChildType(Node n, boolean replace)
Checks the validity of a 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.

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.

export

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

fireDOMSubtreeModifiedEvent

protected void fireDOMSubtreeModifiedEvent()
Fires a DOMSubtreeModified event.

getName

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

Returns: {@link #getNodeName()}.

getNodeName

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

Returns: {@link #nodeName}.

getNodeType

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

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

getNodeValue

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

Returns: The content of the attribute.

getOwnerElement

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

getSchemaTypeInfo

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

getSpecified

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

Returns: !{@link #unspecified}.

getValue

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

Returns: {@link #getNodeValue()}.

isId

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

nodeAdded

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

nodeToBeRemoved

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

setIsId

public void setIsId(boolean isId)
Sets whether this attribute is an ID attribute.

setNodeName

public void setNodeName(String v)
Sets the node name.

setNodeValue

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

setOwnerElement

public void setOwnerElement(AbstractElement v)
Sets the owner element.

setSpecified

public void setSpecified(boolean v)
Sets the specified attribute.

setValue

public void setValue(String value)
DOM: Implements {@link org.w3c.dom.Attr#setValue(String)}.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.