Package gnu.bytecode
Class AnnotationEntry
- java.lang.Object
-
- gnu.bytecode.AnnotationEntry
-
- All Implemented Interfaces:
Annotation
,InvocationHandler
public class AnnotationEntry extends Object implements InvocationHandler, Annotation
An annotation value mirror.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnnotationEntry.Value
-
Constructor Summary
Constructors Constructor Description AnnotationEntry()
AnnotationEntry(ClassType annotationType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMember(String name, AnnotationEntry.Value value)
void
addMember(String name, Object value, Type type)
Class<? extends Annotation>
annotationType()
static AnnotationEntry.Value
asAnnotationValue(Object val, Type type)
boolean
equals(Object obj)
ClassType
getAnnotationType()
RetentionPolicy
getRetention()
int
hashCode()
boolean
hasTarget(ElementType etype)
Is there is a@Target
meta-annotation that includes the parameter? If the annotationType has no@Target
meta-annotation, return true, since in that case the annotation type is allowed in all contexts.Object
invoke(Object proxy, Method method, Object[] args)
void
print(int indentation, ClassTypeWriter dst)
String
toString()
-
-
-
Constructor Detail
-
AnnotationEntry
public AnnotationEntry()
-
AnnotationEntry
public AnnotationEntry(ClassType annotationType)
-
-
Method Detail
-
getRetention
public RetentionPolicy getRetention()
-
hasTarget
public boolean hasTarget(ElementType etype)
Is there is a@Target
meta-annotation that includes the parameter? If the annotationType has no@Target
meta-annotation, return true, since in that case the annotation type is allowed in all contexts. Ifetype==null
, return false iff there is a@Target
meta-annotation.
-
getAnnotationType
public ClassType getAnnotationType()
-
addMember
public void addMember(String name, AnnotationEntry.Value value)
-
asAnnotationValue
public static AnnotationEntry.Value asAnnotationValue(Object val, Type type)
-
annotationType
public Class<? extends Annotation> annotationType()
- Specified by:
annotationType
in interfaceAnnotation
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in interfaceAnnotation
- Overrides:
equals
in classObject
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceAnnotation
- Overrides:
hashCode
in classObject
-
toString
public String toString()
- Specified by:
toString
in interfaceAnnotation
- Overrides:
toString
in classObject
-
print
public void print(int indentation, ClassTypeWriter dst)
-
-