proguard.classfile.attribute.annotation
Class ElementValue

java.lang.Object
  extended by proguard.classfile.attribute.annotation.ElementValue
All Implemented Interfaces:
VisitorAccepter
Direct Known Subclasses:
AnnotationElementValue, ArrayElementValue, ClassElementValue, ConstantElementValue, EnumConstantElementValue

public abstract class ElementValue
extends java.lang.Object
implements VisitorAccepter

This abstract class represents an element value that is attached to an annotation or an annotation default. Specific types of element values are subclassed from it.


Field Summary
 Clazz referencedClass
          An extra field pointing to the referenced Clazz object, if applicable.
 Method referencedMethod
          An extra field pointing to the referenced Method object, if applicable.
 int u2elementNameIndex
          An extra field for the optional element name.
 java.lang.Object visitorInfo
          An extra field in which visitors can store information.
 
Constructor Summary
protected ElementValue()
          Creates an uninitialized ElementValue.
protected ElementValue(int u2elementNameIndex)
          Creates an initialized ElementValue.
 
Method Summary
abstract  void accept(Clazz clazz, Annotation annotation, ElementValueVisitor elementValueVisitor)
          Accepts the given visitor.
 java.lang.String getMethodName(Clazz clazz)
          Returns the element name.
abstract  int getTag()
          Returns the tag of this element value.
 java.lang.Object getVisitorInfo()
          Gets the visitor information of the visitor accepter.
 void referencedMethodAccept(MemberVisitor memberVisitor)
          Applies the given visitor to the referenced method.
 void setVisitorInfo(java.lang.Object visitorInfo)
          Sets the visitor information of the visitor accepter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

u2elementNameIndex

public int u2elementNameIndex
An extra field for the optional element name. It is used in element value pairs of annotations. Otherwise, it is 0.


referencedClass

public Clazz referencedClass
An extra field pointing to the referenced Clazz object, if applicable. This field is typically filled out by the ClassReferenceInitializer.


referencedMethod

public Method referencedMethod
An extra field pointing to the referenced Method object, if applicable. This field is typically filled out by the ClassReferenceInitializer.


visitorInfo

public java.lang.Object visitorInfo
An extra field in which visitors can store information.

Constructor Detail

ElementValue

protected ElementValue()
Creates an uninitialized ElementValue.


ElementValue

protected ElementValue(int u2elementNameIndex)
Creates an initialized ElementValue.

Method Detail

getMethodName

public java.lang.String getMethodName(Clazz clazz)
Returns the element name.


getTag

public abstract int getTag()
Returns the tag of this element value.


accept

public abstract void accept(Clazz clazz,
                            Annotation annotation,
                            ElementValueVisitor elementValueVisitor)
Accepts the given visitor.


referencedMethodAccept

public void referencedMethodAccept(MemberVisitor memberVisitor)
Applies the given visitor to the referenced method.


getVisitorInfo

public java.lang.Object getVisitorInfo()
Description copied from interface: VisitorAccepter
Gets the visitor information of the visitor accepter.

Specified by:
getVisitorInfo in interface VisitorAccepter

setVisitorInfo

public void setVisitorInfo(java.lang.Object visitorInfo)
Description copied from interface: VisitorAccepter
Sets the visitor information of the visitor accepter.

Specified by:
setVisitorInfo in interface VisitorAccepter