org.apache.axiom.om.impl.llom
Class OMAttributeImpl

java.lang.Object
  extended by org.apache.axiom.om.impl.llom.OMAttributeImpl
All Implemented Interfaces:
org.apache.axiom.om.OMAttribute

public class OMAttributeImpl
extends java.lang.Object
implements org.apache.axiom.om.OMAttribute

Class OMAttributeImpl


Field Summary
private  org.apache.axiom.om.OMFactory factory
          OMFactory that created this OMAttribute
private  java.lang.String localName
          Field localName
private  org.apache.axiom.om.OMNamespace namespace
          Field namespace
protected  org.apache.axiom.om.OMElement owner
           
private  java.lang.String value
          Field value
 
Constructor Summary
OMAttributeImpl(java.lang.String localName, org.apache.axiom.om.OMNamespace ns, java.lang.String value, org.apache.axiom.om.OMFactory factory)
          Constructor OMAttributeImpl.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Checks for the equality of two OMAttribute instances.
 java.lang.String getAttributeValue()
          Method getAttributeValue.
 java.lang.String getLocalName()
          Method getLocalName.
 org.apache.axiom.om.OMNamespace getNamespace()
          Method getNamespace.
 org.apache.axiom.om.OMFactory getOMFactory()
           
 org.apache.axiom.om.OMElement getOwner()
          Returns the owner element of this attribute
 javax.xml.namespace.QName getQName()
           
 int hashCode()
           
 void setAttributeValue(java.lang.String value)
          Method setAttributeValue.
 void setLocalName(java.lang.String localName)
          Method setLocalName.
 void setOMNamespace(org.apache.axiom.om.OMNamespace omNamespace)
          Method setOMNamespace.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localName

private java.lang.String localName
Field localName


value

private java.lang.String value
Field value


namespace

private org.apache.axiom.om.OMNamespace namespace
Field namespace


factory

private org.apache.axiom.om.OMFactory factory
OMFactory that created this OMAttribute


owner

protected org.apache.axiom.om.OMElement owner
Constructor Detail

OMAttributeImpl

public OMAttributeImpl(java.lang.String localName,
                       org.apache.axiom.om.OMNamespace ns,
                       java.lang.String value,
                       org.apache.axiom.om.OMFactory factory)
Constructor OMAttributeImpl.

Parameters:
localName -
ns -
value -
Method Detail

getQName

public javax.xml.namespace.QName getQName()
Specified by:
getQName in interface org.apache.axiom.om.OMAttribute
Returns:
Returns QName.

getLocalName

public java.lang.String getLocalName()
Method getLocalName.

Specified by:
getLocalName in interface org.apache.axiom.om.OMAttribute
Returns:
Returns local name.

setLocalName

public void setLocalName(java.lang.String localName)
Method setLocalName.

Specified by:
setLocalName in interface org.apache.axiom.om.OMAttribute
Parameters:
localName -

getAttributeValue

public java.lang.String getAttributeValue()
Method getAttributeValue.

Specified by:
getAttributeValue in interface org.apache.axiom.om.OMAttribute
Returns:
Returns value.

setAttributeValue

public void setAttributeValue(java.lang.String value)
Method setAttributeValue.

Specified by:
setAttributeValue in interface org.apache.axiom.om.OMAttribute
Parameters:
value -

setOMNamespace

public void setOMNamespace(org.apache.axiom.om.OMNamespace omNamespace)
Method setOMNamespace.

Specified by:
setOMNamespace in interface org.apache.axiom.om.OMAttribute
Parameters:
omNamespace -

getNamespace

public org.apache.axiom.om.OMNamespace getNamespace()
Method getNamespace.

Specified by:
getNamespace in interface org.apache.axiom.om.OMAttribute
Returns:
Returns namespace.

getOMFactory

public org.apache.axiom.om.OMFactory getOMFactory()
Specified by:
getOMFactory in interface org.apache.axiom.om.OMAttribute

getOwner

public org.apache.axiom.om.OMElement getOwner()
Returns the owner element of this attribute

Specified by:
getOwner in interface org.apache.axiom.om.OMAttribute
Returns:
OMElement - the owner element

equals

public boolean equals(java.lang.Object obj)
Checks for the equality of two 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.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to compare with this instance.
Returns:
True if obj is equal to this or else false.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object