|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ercp.xml.dom.NodeImpl
org.eclipse.ercp.xml.dom.NSNodeImpl
org.eclipse.ercp.xml.dom.AttrImpl
public class AttrImpl
Field Summary | |
---|---|
protected ElementImpl |
ownerElement
|
protected java.lang.String |
value
|
Fields inherited from class org.eclipse.ercp.xml.dom.NSNodeImpl |
---|
localName, namespaceURI, prefix, qualifiedName |
Fields inherited from class org.eclipse.ercp.xml.dom.NodeImpl |
---|
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 | |
---|---|
AttrImpl(DocumentImpl ownerDocument,
java.lang.String qualifiedName)
Constructor for AttrImpl |
|
AttrImpl(DocumentImpl ownerDocument,
java.lang.String namespaceURI,
java.lang.String qualifiedName)
|
Method Summary | |
---|---|
Node |
cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
java.lang.String |
getName()
Returns the name of this attribute. |
short |
getNodeType()
A code representing the type of the underlying object, as defined above. |
java.lang.String |
getNodeValue()
The value of this node, depending on its type; see the table above. |
Element |
getOwnerElement()
The Element node this attribute is attached to or
null if this attribute is not in use. |
boolean |
getSpecified()
If this attribute was explicitly given a value in the original document, this is true ; otherwise, it is
false . |
java.lang.String |
getValue()
On retrieval, the value of the attribute is returned as a string. |
void |
setNodeValue(java.lang.String nodeValue)
|
void |
setValue(java.lang.String value)
|
Methods inherited from class org.eclipse.ercp.xml.dom.NSNodeImpl |
---|
getLocalName, getNamespaceURI, getNodeName, getPrefix, setPrefix |
Methods inherited from class org.eclipse.ercp.xml.dom.NodeImpl |
---|
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLength, getNextSibling, getOwnerDocument, getParentNode, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, item, normalize, removeChild, replaceChild, spreadOwnerDocument |
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.Node |
---|
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setPrefix |
Field Detail |
---|
protected java.lang.String value
protected ElementImpl ownerElement
Constructor Detail |
---|
public AttrImpl(DocumentImpl ownerDocument, java.lang.String qualifiedName)
public AttrImpl(DocumentImpl ownerDocument, java.lang.String namespaceURI, java.lang.String qualifiedName)
Method Detail |
---|
public java.lang.String getName()
getName
in interface Attr
public boolean getSpecified()
true
; otherwise, it is
false
. Note that the implementation is in charge of this
attribute, not the user. If the user changes the value of the
attribute (even if it ends up having the same value as the default
value) then the specified
flag is automatically flipped
to true
. To re-specify the attribute as the default
value from the DTD, the user must delete the attribute. The
implementation will then make a new attribute available with
specified
set to false
and the default
value (if one exists).
specified
is true
, and the value is
the assigned value. If the attribute has no assigned value in the
document and has a default value in the DTD, then
specified
is false
, and the value is the
default value in the DTD. If the attribute has no assigned value in
the document and has a value of #IMPLIED in the DTD, then the
attribute does not appear in the structure model of the document. If
the ownerElement
attribute is null
(i.e.
because it was just created or was set to null
by the
various removal and cloning operations) specified
is
true
.
getSpecified
in interface Attr
public java.lang.String getValue()
getAttribute
on the
Element
interface.
Text
node with the unparsed
contents of the string. I.e. any characters that an XML processor
would recognize as markup are instead treated as literal text. See
also the method setAttribute
on the Element
interface.
getValue
in interface Attr
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.public void setValue(java.lang.String value) throws DOMException
setValue
in interface Attr
DOMException
public Element getOwnerElement()
Element
node this attribute is attached to or
null
if this attribute is not in use.
getOwnerElement
in interface Attr
public short getNodeType()
getNodeType
in interface Node
public java.lang.String getNodeValue() throws DOMException
null
, setting it has no effect.
getNodeValue
in interface Node
getNodeValue
in class NodeImpl
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
DOMException
- DOMSTRING_SIZE_ERR: Raised when it would return more characters than
fit in a DOMString
variable on the implementation
platform.public void setNodeValue(java.lang.String nodeValue) throws DOMException
setNodeValue
in interface Node
setNodeValue
in class NodeImpl
DOMException
public Node cloneNode(boolean deep)
parentNode
is null
.).
Element
copies all attributes and their
values, including those generated by the XML processor to represent
defaulted attributes, but this method does not copy any text it
contains unless it is a deep clone, since the text is contained in a
child Text
node. Cloning an Attribute
directly, as opposed to be cloned as part of an Element
cloning operation, returns a specified attribute (
specified
is true
). Cloning any other type
of node simply returns a copy of this node.
EntityReference
clone are readonly
. In addition, clones of unspecified Attr
nodes are
specified. And, cloning Document
,
DocumentType
, Entity
, and
Notation
nodes is implementation dependent.
cloneNode
in interface Node
deepIf
- true
, recursively clone the subtree under
the specified node; if false
, clone only the node
itself (and its attributes, if it is an Element
).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |