public class AttrImpl extends RootNode implements OMAttribute, Attr
org.w3c.dom.Attr
and org.apache.axiom.om.OMAttribute
Modifier and Type | Field and Description |
---|---|
protected boolean |
isId
Flag used to mark an attribute as per the DOM Level 3 specification
|
firstChild, lastChild
factory, FIRSTCHILD, flags, HAS_PARENT, SPECIFIED
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
COMPLETE, DISCARDED, INCOMPLETE
Constructor and Description |
---|
AttrImpl(DocumentImpl ownerDocument,
String name,
OMFactory factory) |
AttrImpl(DocumentImpl ownerDocument,
String localName,
OMNamespace namespace,
OMFactory factory) |
AttrImpl(DocumentImpl ownerDocument,
String localName,
OMNamespace ns,
String value,
OMFactory factory) |
AttrImpl(DocumentImpl ownerDocument,
String name,
String value,
OMFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
build() |
boolean |
equals(Object obj)
An instance of
AttrImpl can act as an OMAttribute and as well as an
org.w3c.dom.Attr . |
String |
getAttributeType()
Get the attribute type.
|
String |
getAttributeValue()
Get the attribute value.
|
OMXMLParserWrapper |
getBuilder() |
String |
getLocalName()
Get the local name of the information item.
|
String |
getName() |
OMNamespace |
getNamespace()
Returns the namespace of the attribute as an
OMNamespace . |
String |
getNamespaceURI()
Returns the namespace URI of this attr node.
|
Node |
getNextSibling() |
String |
getNodeName()
Returns the name of this attribute.
|
short |
getNodeType()
Returns the node type.
|
String |
getNodeValue()
Returns the value of this attribute.
|
OMElement |
getOwner()
Returns the owner element of this attribute
|
Element |
getOwnerElement()
Returns the owner element.
|
Node |
getParentNode() |
String |
getPrefix()
Returns the namespace prefix of this attr node.
|
QName |
getQName()
Returns a qname representing the attribute.
|
TypeInfo |
getSchemaTypeInfo() |
boolean |
getSpecified() |
int |
getState() |
String |
getValue()
Returns the value of this attribute.
|
int |
hashCode() |
void |
internalSerialize(XMLStreamWriter writer,
boolean cache) |
void |
internalSetNamespace(OMNamespace namespace)
Set the namespace of the node without adding a corresponding namespace declaration.
|
boolean |
isComplete() |
boolean |
isId() |
String |
lookupNamespaceURI(String specifiedPrefix) |
void |
setAttributeType(String attrType)
Sets the attribute value.
|
void |
setAttributeValue(String value)
Sets the attribute value.
|
void |
setComplete(boolean state) |
void |
setLocalName(String localName)
Sets the name of attribute.
|
void |
setOMNamespace(OMNamespace omNamespace)
Sets the namespace of this attribute node.
|
void |
setPrefix(String prefix) |
void |
setValue(String value)
Sets the value of the attribute.
|
String |
toString() |
addChild, addChild, appendChild, getChildNodes, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDescendants, getFirstChild, getFirstChildWithName, getFirstOMChild, getFirstOMChildIfAvailable, getLastChild, getLastKnownOMChild, getLength, getSAXSource, getTextContent, getXMLStreamReader, getXMLStreamReader, getXMLStreamReader, getXMLStreamReaderWithoutCaching, hasChildNodes, insertBefore, item, removeChild, replaceChild, setFirstChild, setLastChild, setTextContent
buildWithAttachments, clone, cloneNode, close, compareDocumentPosition, detach, getAttributes, getBaseURI, getFeature, getNextOMSiblingIfAvailable, getOMFactory, getOwnerDocument, getParent, getPreviousOMSibling, getPreviousSibling, getUserData, hasAttributes, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupPrefix, normalize, serialize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setNextOMSibling, setNodeValue, setParent, setParent, setPreviousOMSibling, setUserData
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getOwnerDocument, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setTextContent, setUserData
clone, getOMFactory
protected boolean isId
public AttrImpl(DocumentImpl ownerDocument, String localName, OMNamespace ns, String value, OMFactory factory)
public AttrImpl(DocumentImpl ownerDocument, String name, String value, OMFactory factory)
public AttrImpl(DocumentImpl ownerDocument, String name, OMFactory factory)
public AttrImpl(DocumentImpl ownerDocument, String localName, OMNamespace namespace, OMFactory factory)
public String getNodeName()
getNodeName
in interface Node
public short getNodeType()
getNodeType
in interface Node
Node.getNodeType()
public String getNodeValue() throws DOMException
getNodeValue
in interface Node
getNodeValue
in class NodeImpl
DOMException
Node.getNodeValue()
public String getValue()
getValue
in interface Attr
Attr.getValue()
public Element getOwnerElement()
getOwnerElement
in interface Attr
Attr.getOwnerElement()
public boolean getSpecified()
getSpecified
in interface Attr
public OMNamespace getNamespace()
OMNamespace
.getNamespace
in interface OMNamedInformationItem
null
if the information item
has no namespace. Note that this implies that the method never returns an
OMNamespace
object with both prefix and namespace URI set to the empty
string. In addition, the prefix of the returned OMNamespace
object (if any)
is never null
: if a null
prefix was specified when creating
this information item, then a prefix has been automatically assigned and the assigned
prefix is returned.OMNamedInformationItem.getNamespace()
public QName getQName()
getQName
in interface OMNamedInformationItem
QName
for the information itemOMNamedInformationItem.getQName()
public String getAttributeValue()
OMAttribute
getAttributeValue
in interface OMAttribute
null
public String getAttributeType()
OMAttribute
CDATA
.getAttributeType
in interface OMAttribute
public void setLocalName(String localName)
setLocalName
in interface OMNamedInformationItem
localName
- the new local name of the information itemOMNamedInformationItem.setLocalName(String)
public void internalSetNamespace(OMNamespace namespace)
public void setOMNamespace(OMNamespace omNamespace)
setOMNamespace
in interface OMAttribute
(org.apache.axiom.om.OMNamespace)
public void setAttributeValue(String value)
setAttributeValue
in interface OMAttribute
OMAttribute.setAttributeValue(String)
public void setAttributeType(String attrType)
setAttributeType
in interface OMAttribute
OMAttribute.setAttributeType(String)
public void setValue(String value) throws DOMException
setValue
in interface Attr
DOMException
Attr.setValue(String)
public Node getParentNode()
getParentNode
in interface Node
getParentNode
in class NodeImpl
public String getLocalName()
OMNamedInformationItem
getLocalName
in interface OMNamedInformationItem
getLocalName
in interface Node
getLocalName
in class NodeImpl
public String getNamespaceURI()
getNamespaceURI
in interface OMNamedInformationItem
getNamespaceURI
in interface Node
getNamespaceURI
in class NodeImpl
null
if the information
item has no namespaceNode.getNamespaceURI()
public String getPrefix()
getPrefix
in interface OMNamedInformationItem
getPrefix
in interface Node
getPrefix
in class NodeImpl
null
if the information item has
no prefixNode.getPrefix()
public void setPrefix(String prefix) throws DOMException
setPrefix
in interface Node
setPrefix
in class NodeImpl
DOMException
public TypeInfo getSchemaTypeInfo()
getSchemaTypeInfo
in interface Attr
public OMElement getOwner()
OMAttribute
getOwner
in interface OMAttribute
public boolean equals(Object obj)
AttrImpl
can act as an OMAttribute
and as well as an
org.w3c.dom.Attr
. So we first check if the object to compare with (obj
)
is of type OMAttribute
(this includes instances of OMAttributeImpl
or
AttrImpl
(instances of this class)). If so we check for the equality
of namespaces first (note that if the namespace of this instance is null then for the obj
to be equal its namespace must also be null). This condition solely doesn't determine the equality.
So we check for the equality of names and values (note that the value can also be null in which case
the same argument holds as that for the namespace) of the two instances. If all three conditions are
met then we say the two instances are equal.
If obj
is of type org.w3c.dom.Attr
then we perform the same equality check
as before. Note that, however, the implementation of the test for equality in this case is little different
than before.
If obj
is neither of type OMAttribute
nor of type org.w3c.dom.Attr
then we return false.
public void internalSerialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException
internalSerialize
in class NodeImpl
XMLStreamException
public final OMXMLParserWrapper getBuilder()
getBuilder
in interface IParentNode
getBuilder
in class NodeImpl
public final int getState()
getState
in interface IParentNode
public final boolean isComplete()
isComplete
in interface IParentNode
isComplete
in class NodeImpl
public final void setComplete(boolean state)
setComplete
in class NodeImpl
public final void build()
public final Node getNextSibling()
getNextSibling
in interface Node
public final String lookupNamespaceURI(String specifiedPrefix)
lookupNamespaceURI
in interface Node
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.