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 |
---|---|
boolean |
equals(Object obj)
Checks for the equality of two
OMAttribute instances. |
String |
getAttributeType()
Method getAttributeType.
|
String |
getAttributeValue()
Method getAttributeValue.
|
String |
getLocalName()
Method getLocalName.
|
OMNamespace |
getNamespace()
Method getNamespace.
|
OMFactory |
getOMFactory()
Returns the OMFactory that created this object
|
OMElement |
getOwner()
Returns the owner element of this attribute
|
QName |
getQName() |
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()
getQName
in interface OMAttribute
public String getLocalName()
getLocalName
in interface OMAttribute
public void setLocalName(String localName)
setLocalName
in interface OMAttribute
localName
- public String getAttributeValue()
getAttributeValue
in interface OMAttribute
public void setAttributeValue(String value)
setAttributeValue
in interface OMAttribute
value
- public String getAttributeType()
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 OMAttribute
public OMFactory getOMFactory()
OMAttribute
getOMFactory
in interface OMAttribute
public OMElement getOwner()
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.
Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.