Class ElementValue
- java.lang.Object
-
- proguard.util.SimpleProcessable
-
- proguard.classfile.attribute.annotation.ElementValue
-
- All Implemented Interfaces:
java.io.Serializable
,Processable
- Direct Known Subclasses:
AnnotationElementValue
,ArrayElementValue
,ClassElementValue
,ConstantElementValue
,EnumConstantElementValue
public abstract class ElementValue extends SimpleProcessable
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.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description Clazz
referencedClass
An extra field pointing to the referencedClazz
object, if applicable.Method
referencedMethod
An extra field pointing to the referencedMethod
object, if applicable.static char
TAG_ANNOTATION
static char
TAG_ARRAY
static char
TAG_CLASS
static char
TAG_ENUM_CONSTANT
static char
TAG_STRING_CONSTANT
int
u2elementNameIndex
An extra field for the optional element name.-
Fields inherited from class proguard.util.SimpleProcessable
processingFlags, processingInfo
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ElementValue()
Creates an uninitialized ElementValue.protected
ElementValue(int u2elementNameIndex)
Creates an initialized ElementValue.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
accept(Clazz clazz, Annotation annotation, ElementValueVisitor elementValueVisitor)
Accepts the given visitor.java.lang.String
getMethodName(Clazz clazz)
Returns the element name.abstract char
getTag()
Returns the tag of this element value.void
referencedMethodAccept(MemberVisitor memberVisitor)
Applies the given visitor to the referenced method.-
Methods inherited from class proguard.util.SimpleProcessable
addProcessingFlags, getProcessingFlags, getProcessingInfo, hasProcessingFlags, removeProcessingFlags, setProcessingFlags, setProcessingInfo
-
-
-
-
Field Detail
-
TAG_STRING_CONSTANT
public static final char TAG_STRING_CONSTANT
- See Also:
- Constant Field Values
-
TAG_ENUM_CONSTANT
public static final char TAG_ENUM_CONSTANT
- See Also:
- Constant Field Values
-
TAG_CLASS
public static final char TAG_CLASS
- See Also:
- Constant Field Values
-
TAG_ANNOTATION
public static final char TAG_ANNOTATION
- See Also:
- Constant Field Values
-
TAG_ARRAY
public static final char TAG_ARRAY
- See Also:
- Constant Field Values
-
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 referencedClazz
object, if applicable. This field is typically filled out by the
.ClassReferenceInitializer
-
referencedMethod
public Method referencedMethod
An extra field pointing to the referencedMethod
object, if applicable. This field is typically filled out by the
.ClassReferenceInitializer
-
-
Method Detail
-
getMethodName
public java.lang.String getMethodName(Clazz clazz)
Returns the element name.
-
getTag
public abstract char 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.
-
-