org.ow2.asmdex.structureWriter
Class AnnotationElement

java.lang.Object
  extended by org.ow2.asmdex.structureWriter.AnnotationElement
All Implemented Interfaces:
java.lang.Comparable<AnnotationElement>

public class AnnotationElement
extends java.lang.Object
implements java.lang.Comparable<AnnotationElement>

An Annotation Element (from annotation_element structure). Simply consists of the name of the element and its value. CompareTo has been overridden in order to sort these Items by the string_id, like requested by the documentation.

Author:
Julien Névo.

Constructor Summary
AnnotationElement(java.lang.String elementName, EncodedValue encodedValue)
          Constructor of an AnnotationElement.
 
Method Summary
 int compareTo(AnnotationElement ae)
           
 byte[] encode(ConstantPool constantPool)
          Encode the annotation_element according to the format of the same name.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getElementName()
          Gets the Element name.
 EncodedValue getEncodedValue()
          Gets the Value of the Element.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationElement

public AnnotationElement(java.lang.String elementName,
                         EncodedValue encodedValue)
Constructor of an AnnotationElement.

Parameters:
elementName - name of the Element.
encodedValue - value of the Element.
Method Detail

encode

public byte[] encode(ConstantPool constantPool)
Encode the annotation_element according to the format of the same name.


getElementName

public java.lang.String getElementName()
Gets the Element name.

Returns:
the Element name.

getEncodedValue

public EncodedValue getEncodedValue()
Gets the Value of the Element.

Returns:
the Value of the Element.

hashCode

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(AnnotationElement ae)
Specified by:
compareTo in interface java.lang.Comparable<AnnotationElement>