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

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

public class OMAttributeImpl
extends Object
implements OMAttribute

Class OMAttributeImpl


Field Summary
protected  OMElement owner
           
 
Constructor Summary
OMAttributeImpl(String localName, OMNamespace ns, String value, OMFactory factory)
          Constructor OMAttributeImpl.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

owner

protected OMElement owner
Constructor Detail

OMAttributeImpl

public OMAttributeImpl(String localName,
                       OMNamespace ns,
                       String value,
                       OMFactory factory)
Constructor OMAttributeImpl.

Parameters:
localName -
ns -
value -
Method Detail

getQName

public QName getQName()
Specified by:
getQName in interface OMAttribute
Returns:
Returns QName.

getLocalName

public String getLocalName()
Method getLocalName.

Specified by:
getLocalName in interface OMAttribute
Returns:
Returns local name.

setLocalName

public void setLocalName(String localName)
Method setLocalName.

Specified by:
setLocalName in interface OMAttribute
Parameters:
localName -

getAttributeValue

public String getAttributeValue()
Method getAttributeValue.

Specified by:
getAttributeValue in interface OMAttribute
Returns:
Returns value.

setAttributeValue

public void setAttributeValue(String value)
Method setAttributeValue.

Specified by:
setAttributeValue in interface OMAttribute
Parameters:
value -

getAttributeType

public String getAttributeType()
Method getAttributeType.

Specified by:
getAttributeType in interface OMAttribute
Returns:
Returns type.

setAttributeType

public void setAttributeType(String type)
Method setAttributeType.

Specified by:
setAttributeType in interface OMAttribute
Parameters:
type -

setOMNamespace

public void setOMNamespace(OMNamespace omNamespace)
Method setOMNamespace.

Specified by:
setOMNamespace in interface OMAttribute
Parameters:
omNamespace -

getNamespace

public OMNamespace getNamespace()
Method getNamespace.

Specified by:
getNamespace in interface OMAttribute
Returns:
Returns namespace.

getOMFactory

public OMFactory getOMFactory()
Description copied from interface: OMAttribute
Returns the OMFactory that created this object

Specified by:
getOMFactory in interface OMAttribute

getOwner

public OMElement getOwner()
Returns the owner element of this attribute

Specified by:
getOwner in interface OMAttribute
Returns:
OMElement - the owner element

equals

public boolean equals(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 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 Object


Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.