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 classAnnotationEntry.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 voidaddMember(String name, AnnotationEntry.Value value)voidaddMember(String name, Object value, Type type)Class<? extends Annotation>annotationType()static AnnotationEntry.ValueasAnnotationValue(Object val, Type type)booleanequals(Object obj)ClassTypegetAnnotationType()RetentionPolicygetRetention()inthashCode()booleanhasTarget(ElementType etype)Is there is a@Targetmeta-annotation that includes the parameter? If the annotationType has no@Targetmeta-annotation, return true, since in that case the annotation type is allowed in all contexts.Objectinvoke(Object proxy, Method method, Object[] args)voidprint(int indentation, ClassTypeWriter dst)StringtoString()
-
-
-
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@Targetmeta-annotation that includes the parameter? If the annotationType has no@Targetmeta-annotation, return true, since in that case the annotation type is allowed in all contexts. Ifetype==null, return false iff there is a@Targetmeta-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:
annotationTypein interfaceAnnotation
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceAnnotation- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceAnnotation- Overrides:
hashCodein classObject
-
toString
public String toString()
- Specified by:
toStringin interfaceAnnotation- Overrides:
toStringin classObject
-
print
public void print(int indentation, ClassTypeWriter dst)
-
-