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, 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| 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, setTextContentbuildWithAttachments, 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, 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, getOMFactoryprotected 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 Nodepublic short getNodeType()
getNodeType in interface NodeNode.getNodeType()public String getNodeValue() throws DOMException
getNodeValue in interface NodegetNodeValue in class NodeImplDOMExceptionNode.getNodeValue()public String getValue()
getValue in interface AttrAttr.getValue()public Element getOwnerElement()
getOwnerElement in interface AttrAttr.getOwnerElement()public boolean getSpecified()
getSpecified in interface 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 QName getQName()
getQName in interface OMNamedInformationItemQName for the information itemOMNamedInformationItem.getQName()public String getAttributeValue()
OMAttributegetAttributeValue in interface OMAttributenull
public String getAttributeType()
OMAttributeCDATA.getAttributeType in interface OMAttributepublic void setLocalName(String localName)
setLocalName in interface OMNamedInformationItemlocalName - 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 OMAttributeOMAttribute.setAttributeValue(String)public void setAttributeType(String attrType)
setAttributeType in interface OMAttributeOMAttribute.setAttributeType(String)public void setValue(String value) throws DOMException
setValue in interface AttrDOMExceptionAttr.setValue(String)public Node getParentNode()
getParentNode in interface NodegetParentNode in class NodeImplpublic String getLocalName()
OMNamedInformationItemgetLocalName in interface OMNamedInformationItemgetLocalName in interface NodegetLocalName in class NodeImplpublic String getNamespaceURI()
getNamespaceURI in interface OMNamedInformationItemgetNamespaceURI in interface NodegetNamespaceURI in class NodeImplnull if the information
item has no namespaceNode.getNamespaceURI()public String getPrefix()
getPrefix in interface OMNamedInformationItemgetPrefix in interface NodegetPrefix in class NodeImplnull if the information item has
no prefixNode.getPrefix()public void setPrefix(String prefix) throws DOMException
setPrefix in interface NodesetPrefix in class NodeImplDOMExceptionpublic TypeInfo getSchemaTypeInfo()
getSchemaTypeInfo in interface Attrpublic OMElement getOwner()
OMAttributegetOwner in interface OMAttributepublic 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 NodeImplXMLStreamExceptionpublic 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 void build()
public final Node getNextSibling()
getNextSibling in interface Nodepublic final String lookupNamespaceURI(String specifiedPrefix)
lookupNamespaceURI in interface NodeCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.