public class XMLAttr extends XMLNSNode implements Attr, NSName, java.io.Externalizable
ATTRDECL, Auto_Events, capturing, DOMAttrModified, DOMCharacterDataModified, DOMNodeInserted, DOMNodeInsertedIntoDocument, DOMNodeRemoved, DOMNodeRemovedFromDocument, DOMSubtreeModified, ELEMENTDECL, KEPT_NODE, NAMESPACE_NODE, noncapturing, RANGE_DELETE_EVENT, RANGE_DELETETEXT_EVENT, RANGE_INSERT_EVENT, RANGE_INSERTTEXT_EVENT, RANGE_REPLACE_EVENT, RANGE_SETTEXT_EVENT, SCHEMA_NILLED, TRAVERSAL_DELETE_EVENT, TRAVERSAL_REPLACE_EVENT, XMLDECL_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
VAL_FALSE, VAL_INCOMPLETE, VAL_NS_WF, VAL_SCHEMA, VAL_TRUE, VAL_UNKNOWN, VAL_WF
Constructor and Description |
---|
XMLAttr()
Deprecated.
use createAttribute(String) or createAttributeNS(String, String) of XMLDocument
|
XMLAttr(java.lang.String n, java.lang.String v)
Deprecated.
use createAttribute(String) method of XMLDocument
|
XMLAttr(java.lang.String name, java.lang.String prefix, java.lang.String namespace, java.lang.String v)
Deprecated.
use createAttributeNS(String, String) method of XMLDocument
|
XMLAttr(java.lang.String name, java.lang.String prefix, java.lang.String qname, java.lang.String namespace, java.lang.String v)
Deprecated.
use crateAttribute(String) or createAttributeNS(String, String) of XMLDocument
|
Modifier and Type | Method and Description |
---|---|
XMLNode |
addText(java.lang.String str)
Append the given value to the attribute value
|
short |
canRemoveChild(Node oldChild)
Determines whether the
Node.removeChild operation would make this document not compliant with the VAL_INCOMPLETE validity type. |
DOMStringList |
getEnumeratedValues()
A
DOMStringList , as described in [DOM Level 3 Core] , of distinct values for an attribute or an element declaration or null if unspecified. |
java.lang.String |
getExpandedName()
Gets the fully resolved Name for this attribute
|
Node |
getFirstChild()
Gets the first child of this node.
|
Node |
getLastChild()
Gets the last child of this node.
|
java.lang.String |
getLocalName()
Gets the Local Name of this node
|
java.lang.String |
getName()
Gets the attribute name.
|
java.lang.String |
getNamespaceURI()
Gets the namespace URI of this node.
|
XMLAttr |
getNextAttribute()
Gets the next attribute if any
|
Node |
getNextSibling()
Gets The node immediately following this node.
|
java.lang.String |
getNodeName()
Gets the name of this node, depending on its type
|
short |
getNodeType()
Gets a code representing the type of the underlying object
|
java.lang.String |
getNodeValue()
Gets the value of this node, depending on its type
|
Element |
getOwnerElement()
Gets the element which owns this attribute
|
Node |
getParentNode()
Gets the parent of this node.
|
java.lang.String |
getPrefix()
Get the namespace prefix for this element.
|
XMLAttr |
getPrevAttribute()
Deprecated.
|
Node |
getPreviousSibling()
Gets the node immediately preceding this node.
|
java.lang.String |
getQualifiedName()
Gets the qualified name for this attribute
|
TypeInfo |
getSchemaTypeInfo()
The type information associated with this attribute.
|
boolean |
getSpecified()
Returns true if the attribute was specified explicity in the element
|
java.lang.String |
getText()
Gets the attribute value.
|
java.lang.String |
getValue()
Gets the attribute value.
|
void |
setNodeValue(java.lang.String nodeValue)
Sets the value of this node, depending on its type
|
void |
setPrefix(java.lang.String prefix)
Sets the prefix for attribute Note that setting the prefix, when permitted, changes the nodeName.
|
void |
setValue(java.lang.String arg)
Sets the value.
|
addText, appendChild, getChildNodes, insertBefore, normalize, removeChild, replaceChild
addEventListener, canAppendChild, canInsertBefore, canReplaceChild, cloneNode, dispatchEvent, equals, getAttributes, getColumnNumber, getDebugMode, getDefaultValue, getFirstChildAsOffset, getLineNumber, getNextSiblingAsOffset, getNodeValueAsBinaryStream, getNodeValueAsBinaryStream, getNodeValueAsCharacterStream, getNodeValueAsCharacterStream, getOwnerDocument, getPrimitiveTypeId, getProperty, getSystemId, getXMLError, hasAttributes, hasChildNodes, hashCode, isDocumentFlag, isNodeFlag, isSupported, nodeValidity, print, print, print, print, readExternal, removeEventListener, reportSAXEvents, resetNodeFlag, selectNodes, selectNodes, selectSingleNode, selectSingleNode, setDebugInfo, setNodeFlag, setNodeFlag, setNodeFlag, setNodeValueAsBinaryStream, setNodeValueAsBinaryStream, setNodeValueAsCharacterStream, setNodeValueAsCharacterStream, setProperty, transformNode, valueOf, valueOf, writeExternal, xdbGetNodeId
getClass, notify, notifyAll, toString, wait, wait, wait
appendChild, cloneNode, getAttributes, getChildNodes, getOwnerDocument, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild
getNamespace
public XMLAttr()
public XMLAttr(java.lang.String n, java.lang.String v)
n
- Name of the attributev
- Value of the attributepublic XMLAttr(java.lang.String name, java.lang.String prefix, java.lang.String namespace, java.lang.String v)
name
- Local name of the attributeprefix
- Prefix of the attributenamespace
- Namespace of the attributev
- Value of the attributepublic XMLAttr(java.lang.String name, java.lang.String prefix, java.lang.String qname, java.lang.String namespace, java.lang.String v)
name
- Local name of the attributeprefix
- Prefix of the attributeqname
- Qname of the attributenamespace
- Namespace of the attributev
- Value of the attributepublic short getNodeType()
getNodeType
in interface Node
getNodeType
in class XMLNode
public java.lang.String getNodeName()
getNodeName
in interface Node
getNodeName
in class XMLNode
public java.lang.String getName()
public java.lang.String getLocalName()
getLocalName
in interface NSName
getLocalName
in interface Node
getLocalName
in class XMLNode
public java.lang.String getNamespaceURI()
getNamespaceURI
in interface Node
getNamespaceURI
in class XMLNode
public java.lang.String getPrefix()
public void setPrefix(java.lang.String prefix) throws DOMException
setPrefix
in interface Node
setPrefix
in class XMLNode
prefix
- Sets the prefix of the nodeDOMException
- if any DOM Exception occurspublic final java.lang.String getText()
public java.lang.String getValue()
public java.lang.String getNodeValue() throws DOMException
getNodeValue
in interface Node
getNodeValue
in class XMLNode
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString
variable on the implementation platform.public void setValue(java.lang.String arg) throws DOMException
setValue
in interface Attr
arg
- Value to setDOMException
public void setNodeValue(java.lang.String nodeValue) throws DOMException
setNodeValue
in interface Node
setNodeValue
in class XMLNode
nodeValue
- the value of thenode to be setDOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString
variable on the implementation platform.public Node getParentNode()
Document
, DocumentFragment
, and Attr
may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null
.getParentNode
in interface Node
getParentNode
in class XMLNode
public Element getOwnerElement()
getOwnerElement
in interface Attr
public boolean getSpecified()
getSpecified
in interface Attr
true
, if the attribute was specified explicitly, false
, if it was notpublic Node getNextSibling()
null
.getNextSibling
in interface Node
getNextSibling
in class XMLNode
public Node getPreviousSibling()
null
.getPreviousSibling
in interface Node
getPreviousSibling
in class XMLNode
public TypeInfo getSchemaTypeInfo()
Document.normalizeDocument()
, schemaTypeInfo
may not be reliable if the node was moved.public short canRemoveChild(Node oldChild)
Node.removeChild
operation would make this document not compliant with the VAL_INCOMPLETE
validity type.canRemoveChild
in interface NodeEditVAL
canRemoveChild
in class XMLNode
oldChild
- Node
to be removed.public DOMStringList getEnumeratedValues()
DOMStringList
, as described in [DOM Level 3 Core] , of distinct values for an attribute or an element declaration or null
if unspecified. If the schema is a W3C XML schema, this is a list of strings which are lexical representations corresponding to the values in the [value] property of the enumeration component for the type of the attribute or element. It is recommended that the canonical lexical representations of the values be used.getEnumeratedValues
in interface NodeEditVAL
getEnumeratedValues
in class XMLNode
public java.lang.String getQualifiedName()
getQualifiedName
in interface NSName
public java.lang.String getExpandedName()
getExpandedName
in interface NSName
public XMLAttr getNextAttribute()
public XMLNode addText(java.lang.String str)
public Node getFirstChild()
null
.getFirstChild
in interface Node
getFirstChild
in class XMLNSNode
public Node getLastChild()
null
.getLastChild
in interface Node
getLastChild
in class XMLNSNode
public XMLAttr getPrevAttribute()