public class OMAttributeImpl extends Object implements OMAttribute
Constructor and Description |
---|
OMAttributeImpl(String localName,
OMNamespace ns,
String value,
OMFactory factory)
Constructor OMAttributeImpl.
|
Modifier and Type | Method and Description |
---|---|
OMInformationItem |
clone(OMCloneOptions options)
Clone this information item.
|
boolean |
equals(Object obj)
Checks for the equality of two
OMAttribute instances. |
String |
getAttributeType()
Get the attribute type.
|
String |
getAttributeValue()
Get the attribute value.
|
String |
getLocalName()
Method getLocalName.
|
OMNamespace |
getNamespace()
Method getNamespace.
|
String |
getNamespaceURI()
Get the namespace URI of this information item.
|
OMFactory |
getOMFactory()
Get the
OMFactory that created this information item. |
OMElement |
getOwner()
Returns the owner element of this attribute
|
String |
getPrefix()
Get the prefix of this information item.
|
QName |
getQName()
Get the QName of this information item.
|
int |
hashCode() |
void |
setAttributeType(String type)
Method setAttributeType.
|
void |
setAttributeValue(String value)
Method setAttributeValue.
|
void |
setLocalName(String localName)
Method setLocalName.
|
void |
setOMNamespace(OMNamespace omNamespace)
Method setOMNamespace.
|
protected OMElement owner
public OMAttributeImpl(String localName, OMNamespace ns, String value, OMFactory factory)
localName
- ns
- value
- public QName getQName()
OMNamedInformationItem
getQName
in interface OMNamedInformationItem
public String getLocalName()
getLocalName
in interface OMNamedInformationItem
public void setLocalName(String localName)
setLocalName
in interface OMNamedInformationItem
localName
- public String getAttributeValue()
OMAttribute
getAttributeValue
in interface OMAttribute
null
public void setAttributeValue(String value)
setAttributeValue
in interface OMAttribute
value
- public String getAttributeType()
OMAttribute
CDATA
.getAttributeType
in interface OMAttribute
public void setAttributeType(String type)
setAttributeType
in interface OMAttribute
type
- public void setOMNamespace(OMNamespace omNamespace)
setOMNamespace
in interface OMAttribute
omNamespace
- public OMNamespace getNamespace()
getNamespace
in interface OMNamedInformationItem
public String getPrefix()
OMNamedInformationItem
Node.getPrefix()
(when called on an Element
or Attr
).getPrefix
in interface OMNamedInformationItem
null
if the information item has
no prefixpublic String getNamespaceURI()
OMNamedInformationItem
Node.getNamespaceURI()
(when called on an
Element
or Attr
).getNamespaceURI
in interface OMNamedInformationItem
null
if the information
item has no namespacepublic OMFactory getOMFactory()
OMInformationItem
OMFactory
that created this information item.getOMFactory
in interface OMInformationItem
public OMElement getOwner()
OMAttribute
getOwner
in interface OMAttribute
public boolean equals(Object obj)
OMAttribute
instances. Thus the object to compare
this with may be an instance of OMAttributeImpl
(an instance of this class) or
an instance of AttrImpl
. The method returns false for any object of type other
than OMAttribute
.
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.
Note: We ignore the owner when checking for the equality. This is simply because the owner is
introduced just to keep things simple for the programmer and not as part of an attribute itself.
public OMInformationItem clone(OMCloneOptions options)
OMInformationItem
clone
in interface OMInformationItem
options
- the options to use when cloning this element and its descendants; for object
models with domain specific extensions (such as SOAP), this may be a subclass of
OMCloneOptions
Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.