|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openxml.dom.NodeImpl
org.openxml.dom.ParentNodeImpl
org.openxml.dom.ParentNSNodeImpl
org.openxml.dom.AttrImpl
public final class AttrImpl
Represents an attribute in an Element node.
Attributes are not real nodes, they are not children in their parent element. Siblings and parents are not accessible.
Attributes in XML documents support children, but only of the type Text and EntityReference.
The specified value of an attribute indicates whether it's value has been changed since it was constructed with the default value. The specified value is not used when cloning an attribute or testing for equality.
To speed up implementation, all attributes are implemented as double-linked
list using ParentNodeImpl. Namespace support is provided by
ParentNSNodeImpl.
Attr,
ParentNSNodeImpl,
ElementImpl| Field Summary |
|---|
| Fields inherited from class org.openxml.dom.NodeImpl |
|---|
ATTLIST_DECL_NODE, ELEMENT_DECL_NODE, PARAM_ENTITY_NODE |
| Method Summary | |
|---|---|
protected NodeImpl |
castNewChild(Node newChild)
Assures that the children of an attribute are either Text or EntityReference. |
Object |
clone()
|
protected void |
cloneInto(NodeImpl into,
boolean deep)
This clone method is called after a new node has been constructed to copy the contents of this node into the new one. |
Node |
cloneNode(boolean deep)
|
short |
compareDocumentPosition(Node other)
|
String |
getBaseURI()
|
Object |
getFeature(String feature,
String version)
|
String |
getName()
|
protected AttrImpl |
getNextAttr()
Return the next attribute following this one. |
Node |
getNextSibling()
Returns the next sibling of this node. |
short |
getNodeType()
Abstract method must be implemented by each node class. |
Element |
getOwnerElement()
Returns the element node this attribute is attached to, or null if attribute not in use in any element. |
Node |
getParentNode()
Returns the parent node of this node. |
Node |
getPreviousSibling()
Returns the previous sibling of this node. |
TypeInfo |
getSchemaTypeInfo()
|
boolean |
getSpecified()
|
String |
getTextContent()
|
Object |
getUserData(String key)
|
String |
getValue()
|
boolean |
hasAttributes()
|
boolean |
isDefaultNamespace(String namespaceURI)
|
boolean |
isEqualNode(Node arg)
|
boolean |
isId()
|
boolean |
isSameNode(Node other)
|
boolean |
isSupported(String feature,
String version)
|
String |
lookupNamespaceURI(String prefix)
|
String |
lookupPrefix(String namespaceURI)
|
void |
setNodeValue(String value)
Changes the value of the node. |
void |
setTextContent(String textContent)
|
Object |
setUserData(String key,
Object data,
UserDataHandler handler)
|
void |
setValue(String value)
|
String |
toString()
|
| Methods inherited from class org.openxml.dom.ParentNSNodeImpl |
|---|
equals, getLocalName, getNamespaceURI, getPrefix, setPrefix |
| Methods inherited from class org.openxml.dom.ParentNodeImpl |
|---|
appendChild, castOldChild, createNodeIterator, getChildNodes, getFirstChild, getLastChild, hasChildNodes, insertBefore, normalize, removeChild, removeInnerIterator, replaceChild |
| Methods inherited from class org.openxml.dom.NodeImpl |
|---|
getAttributes, getNodeName, getNodeValue, getOwnerDocument, isReadOnly, makeReadOnly, setOwnerDocument, supports |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.Node |
|---|
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNodeName, getNodeValue, getOwnerDocument, getPrefix, hasChildNodes, insertBefore, normalize, removeChild, replaceChild, setPrefix |
| Method Detail |
|---|
public short getNodeType()
NodeImpl
getNodeType in interface NodegetNodeType in class NodeImplNode.getNodeType()public String getName()
getName in interface Attrpublic boolean getSpecified()
getSpecified in interface Attrpublic String getValue()
getValue in interface Attrpublic void setNodeValue(String value)
NodeImplElement Not supported Attr Supported Text Supported CDATASection Supported EntityReference Not supported Entity Not supported ProcessingInstruction Supported Comment Supported Document Not supported DocumentType Not supported DocumentFragment Not supported Notation Not supportedFor most node types, if the value is set to null,
NodeImpl.getNodeValue()
will return an empty string instead.
setNodeValue in interface NodesetNodeValue in class NodeImplvalue - New value of nodepublic void setValue(String value)
setValue in interface Attrpublic Node getParentNode()
NodeImplDocument node is always
parentless.
getParentNode in interface NodegetParentNode in class NodeImplpublic Node getPreviousSibling()
NodeImpl
getPreviousSibling in interface NodegetPreviousSibling in class NodeImplpublic Node getNextSibling()
NodeImpl
getNextSibling in interface NodegetNextSibling in class NodeImplpublic Element getOwnerElement()
getOwnerElement in interface Attrpublic String toString()
toString in class Objectpublic final Object clone()
clone in class Objectpublic final Node cloneNode(boolean deep)
cloneNode in interface Nodeprotected AttrImpl getNextAttr()
getNextSibling()
returns null by definition of DOM, but outside classes (ElementImpl and AttrNodeMap) require traversal over attribute
list.
protected void cloneInto(NodeImpl into,
boolean deep)
NodeImplNodeImpl.equals(java.lang.Object)).
into must be a valid node of the exact same class as this one. deep is true if deep cloning (includes all children nodes) is to be performed. If deep is false, the clone might not pass the equality test.
Derived classes override and call this method to add per-class variable
copying. This method is called by Node.cloneNode(boolean) and the default
Object.clone() method.
Contents cloning duplicates the node's name and value, and its children. It does not duplicate it's context, that is, the node's parent or sibling. Initially a clone node has no parents or siblings. However, the node does belong to the same document, since all nodes must belong to some document. The cloned node is never read-only.
cloneInto in class ParentNSNodeImplinto - A node into which to duplicate this onedeep - True if deep cloning is required
protected NodeImpl castNewChild(Node newChild)
throws DOMException
Text or EntityReference.
castNewChild in class ParentNodeImplnewChild - New child node
NodeImpl
DOMException - HIERARCHY_REQUEST_ERR
newChild is null, does not belong to this DOM, or its node
type is not supported for this parentpublic TypeInfo getSchemaTypeInfo()
getSchemaTypeInfo in interface Attrpublic boolean isId()
isId in interface Attr
public short compareDocumentPosition(Node other)
throws DOMException
compareDocumentPosition in interface NodeDOMExceptionpublic String getBaseURI()
getBaseURI in interface Node
public Object getFeature(String feature,
String version)
getFeature in interface Node
public String getTextContent()
throws DOMException
getTextContent in interface NodeDOMExceptionpublic Object getUserData(String key)
getUserData in interface Nodepublic boolean isDefaultNamespace(String namespaceURI)
isDefaultNamespace in interface Nodepublic boolean isEqualNode(Node arg)
isEqualNode in interface Nodepublic boolean isSameNode(Node other)
isSameNode in interface Nodepublic String lookupNamespaceURI(String prefix)
lookupNamespaceURI in interface Nodepublic String lookupPrefix(String namespaceURI)
lookupPrefix in interface Node
public void setTextContent(String textContent)
throws DOMException
setTextContent in interface NodeDOMException
public Object setUserData(String key,
Object data,
UserDataHandler handler)
setUserData in interface Nodepublic boolean hasAttributes()
hasAttributes in interface Node
public boolean isSupported(String feature,
String version)
isSupported in interface Node
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||