public class AttrImpl extends RootNode implements OMAttribute, org.w3c.dom.Attr, NamedNode
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
|
private java.lang.String |
localName |
private OMNamespace |
namespace
The namespace of this attribute.
|
private ParentNode |
owner
Owner of this attribute.
|
private java.lang.String |
type |
firstChild, lastChildfactory, FIRSTCHILD, flags, HAS_PARENT, SPECIFIEDATTRIBUTE_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_NODECOMPLETE, DISCARDED, INCOMPLETE| Modifier | Constructor and Description |
|---|---|
private |
AttrImpl(DocumentImpl ownerDocument,
OMFactory factory) |
|
AttrImpl(DocumentImpl ownerDocument,
java.lang.String name,
OMFactory factory) |
|
AttrImpl(DocumentImpl ownerDocument,
java.lang.String localName,
OMNamespace namespace,
OMFactory factory) |
|
AttrImpl(DocumentImpl ownerDocument,
java.lang.String localName,
OMNamespace ns,
java.lang.String value,
OMFactory factory) |
|
AttrImpl(DocumentImpl ownerDocument,
java.lang.String name,
java.lang.String value,
OMFactory factory) |
private |
AttrImpl(java.lang.String localName,
OMNamespace namespace,
java.lang.String type,
OMFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
build() |
(package private) void |
checkInUse() |
boolean |
equals(java.lang.Object obj)
An instance of
AttrImpl can act as an OMAttribute and as well as an
org.w3c.dom.Attr. |
java.lang.String |
getAttributeType()
Get the attribute type.
|
java.lang.String |
getAttributeValue()
Get the attribute value.
|
OMXMLParserWrapper |
getBuilder() |
java.lang.String |
getLocalName()
Get the local name of the information item.
|
java.lang.String |
getName() |
OMNamespace |
getNamespace()
Returns the namespace of the attribute as an
OMNamespace. |
java.lang.String |
getNamespaceURI()
Returns the namespace URI of this attr node.
|
org.w3c.dom.Node |
getNextSibling() |
java.lang.String |
getNodeName()
Returns the name of this attribute.
|
short |
getNodeType()
Returns the node type.
|
java.lang.String |
getNodeValue()
Returns the value of this attribute.
|
OMElement |
getOwner()
Returns the owner element of this attribute
|
org.w3c.dom.Element |
getOwnerElement()
Returns the owner element.
|
org.w3c.dom.Node |
getParentNode() |
java.lang.String |
getPrefix()
Returns the namespace prefix of this attr node.
|
javax.xml.namespace.QName |
getQName()
Returns a qname representing the attribute.
|
org.w3c.dom.TypeInfo |
getSchemaTypeInfo() |
boolean |
getSpecified() |
int |
getState() |
java.lang.String |
getValue()
Returns the value of this attribute.
|
int |
hashCode() |
(package private) ParentNode |
internalGetOwnerNode()
Get the parent or the owner document of the node.
|
void |
internalSerialize(javax.xml.stream.XMLStreamWriter writer,
boolean cache) |
void |
internalSetNamespace(OMNamespace namespace)
Set the namespace of the node without adding a corresponding namespace declaration.
|
(package private) void |
internalSetOwnerNode(ParentNode ownerNode) |
boolean |
isComplete() |
boolean |
isId() |
java.lang.String |
lookupNamespaceURI(java.lang.String specifiedPrefix) |
void |
setAttributeType(java.lang.String attrType)
Sets the attribute value.
|
void |
setAttributeValue(java.lang.String value)
Sets the attribute value.
|
void |
setComplete(boolean state) |
void |
setLocalName(java.lang.String localName)
Sets the name of attribute.
|
void |
setOMNamespace(OMNamespace omNamespace)
Sets the namespace of this attribute node.
|
(package private) void |
setOwnerElement(ElementImpl element,
boolean useDomSemantics) |
void |
setPrefix(java.lang.String prefix) |
void |
setValue(java.lang.String value)
Sets the value of the attribute.
|
(package private) ParentNode |
shallowClone(OMCloneOptions options,
ParentNode targetParent,
boolean namespaceRepairing) |
java.lang.String |
toString() |
internalGetNextSibling, internalGetPreviousSibling, internalSetNextSibling, internalSetPreviousSiblingaddChild, addChild, appendChild, clone, getChildNodes, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDescendants, getFirstChild, getFirstChildWithName, getFirstOMChild, getFirstOMChildIfAvailable, getLastChild, getLastKnownOMChild, getLength, getSAXSource, getTextContent, getTextContent, getXMLStreamReader, getXMLStreamReader, getXMLStreamReader, getXMLStreamReaderWithoutCaching, hasChildNodes, insertBefore, internalAppendChild, item, normalize, notifyChildComplete, removeChild, replaceChild, setFirstChild, setLastChild, setTextContentbuildWithAttachments, checkSameOwnerDocument, clone, cloneNode, close, compareDocumentPosition, detach, detach, getAttributes, getBaseURI, getFeature, getNextOMSiblingIfAvailable, getOMFactory, getOwnerDocument, getParent, getPreviousOMSibling, getPreviousSibling, getUserData, hasAttributes, hasParent, hasParent, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, isDefaultNamespace, isEqualNode, isFirstChild, isFirstChild, isSameNode, isSpecified, isSpecified, isSupported, lookupPrefix, normalize, ownerDocument, parentNode, serialize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setNextOMSibling, setNodeValue, setOwnerDocument, setParent, setParent, setPreviousOMSibling, setUserDataclone, finalize, getClass, notify, notifyAll, wait, wait, waitappendChild, 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, setUserDataclone, getOMFactoryprivate java.lang.String localName
private java.lang.String type
private OMNamespace namespace
null (if the attribute has no namespace)
OMNamespace instance, with the following exceptions:
OMNamespace instance with a null prefix
OMNamespace instance with an empty prefix (because an unprefixed attribute
never has a namespace)
private ParentNode owner
protected boolean isId
private AttrImpl(DocumentImpl ownerDocument, OMFactory factory)
private AttrImpl(java.lang.String localName,
OMNamespace namespace,
java.lang.String type,
OMFactory factory)
public AttrImpl(DocumentImpl ownerDocument, java.lang.String localName, OMNamespace ns, java.lang.String value, OMFactory factory)
public AttrImpl(DocumentImpl ownerDocument, java.lang.String name, java.lang.String value, OMFactory factory)
public AttrImpl(DocumentImpl ownerDocument, java.lang.String name, OMFactory factory)
public AttrImpl(DocumentImpl ownerDocument, java.lang.String localName, OMNamespace namespace, OMFactory factory)
final ParentNode internalGetOwnerNode()
NodeImplNodeImpl.HAS_PARENT flag.internalGetOwnerNode in class NodeImplfinal void internalSetOwnerNode(ParentNode ownerNode)
internalSetOwnerNode in class NodeImplpublic java.lang.String getNodeName()
getNodeName in interface org.w3c.dom.Nodepublic short getNodeType()
getNodeType in interface org.w3c.dom.NodeNode.getNodeType()public java.lang.String getNodeValue()
throws org.w3c.dom.DOMException
getNodeValue in interface org.w3c.dom.NodegetNodeValue in class NodeImplorg.w3c.dom.DOMExceptionNode.getNodeValue()public java.lang.String getValue()
getValue in interface org.w3c.dom.AttrAttr.getValue()public java.lang.String getName()
getName in interface org.w3c.dom.Attrpublic org.w3c.dom.Element getOwnerElement()
getOwnerElement in interface org.w3c.dom.AttrAttr.getOwnerElement()void setOwnerElement(ElementImpl element, boolean useDomSemantics)
public boolean getSpecified()
getSpecified in interface org.w3c.dom.Attrpublic OMNamespace getNamespace()
OMNamespace.getNamespace in interface OMNamedInformationItemnull 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 javax.xml.namespace.QName getQName()
getQName in interface OMNamedInformationItemQName for the information itemOMNamedInformationItem.getQName()public java.lang.String getAttributeValue()
OMAttributegetAttributeValue in interface OMAttributenull
public java.lang.String getAttributeType()
OMAttributeCDATA.getAttributeType in interface OMAttributepublic void setLocalName(java.lang.String localName)
setLocalName in interface OMNamedInformationItemlocalName - the new local name of the information itemOMNamedInformationItem.setLocalName(String)public void internalSetNamespace(OMNamespace namespace)
NamedNodeinternalSetNamespace in interface NamedNodepublic void setOMNamespace(OMNamespace omNamespace)
setOMNamespace in interface OMAttribute(org.apache.axiom.om.OMNamespace)public void setAttributeValue(java.lang.String value)
setAttributeValue in interface OMAttributeOMAttribute.setAttributeValue(String)public void setAttributeType(java.lang.String attrType)
setAttributeType in interface OMAttributeOMAttribute.setAttributeType(String)final void checkInUse()
public void setValue(java.lang.String value)
throws org.w3c.dom.DOMException
setValue in interface org.w3c.dom.Attrorg.w3c.dom.DOMExceptionAttr.setValue(String)public org.w3c.dom.Node getParentNode()
getParentNode in interface org.w3c.dom.NodegetParentNode in class NodeImplpublic java.lang.String getLocalName()
OMNamedInformationItemgetLocalName in interface OMNamedInformationItemgetLocalName in interface org.w3c.dom.NodegetLocalName in class NodeImplpublic java.lang.String getNamespaceURI()
getNamespaceURI in interface OMNamedInformationItemgetNamespaceURI in interface org.w3c.dom.NodegetNamespaceURI in class NodeImplnull if the information
item has no namespaceNode.getNamespaceURI()public java.lang.String getPrefix()
getPrefix in interface OMNamedInformationItemgetPrefix in interface org.w3c.dom.NodegetPrefix in class NodeImplnull if the information item has
no prefixNode.getPrefix()public void setPrefix(java.lang.String prefix)
throws org.w3c.dom.DOMException
public org.w3c.dom.TypeInfo getSchemaTypeInfo()
getSchemaTypeInfo in interface org.w3c.dom.Attrpublic boolean isId()
isId in interface org.w3c.dom.Attrpublic java.lang.String toString()
toString in class java.lang.Objectpublic OMElement getOwner()
OMAttributegetOwner in interface OMAttributepublic boolean equals(java.lang.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.
equals in class java.lang.Objectobj - The object to compare with this instancepublic int hashCode()
hashCode in class java.lang.Objectpublic void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
boolean cache)
throws javax.xml.stream.XMLStreamException
internalSerialize in class NodeImpljavax.xml.stream.XMLStreamExceptionParentNode shallowClone(OMCloneOptions options, ParentNode targetParent, boolean namespaceRepairing)
shallowClone in class ParentNodepublic final OMXMLParserWrapper getBuilder()
getBuilder in interface IParentNodegetBuilder in class NodeImplpublic final int getState()
getState in interface IParentNodepublic final boolean isComplete()
isComplete in interface IParentNodeisComplete in class NodeImplpublic final void setComplete(boolean state)
setComplete in class NodeImplpublic final org.w3c.dom.Node getNextSibling()
getNextSibling in interface org.w3c.dom.Nodepublic final java.lang.String lookupNamespaceURI(java.lang.String specifiedPrefix)
lookupNamespaceURI in interface org.w3c.dom.Node