public class HasAnnotation extends ClassVisitor
api, cv
Constructor and Description |
---|
HasAnnotation(ClassVisitor v,
Class<? extends Annotation> annotation) |
Modifier and Type | Method and Description |
---|---|
static boolean |
hasAnnotation(byte[] classBytes,
Class<? extends Annotation> annotation)
A utility method to determine if the class defined in
classBytes has a particular annotation. |
boolean |
isFound() |
AnnotationVisitor |
visitAnnotation(String desc,
boolean visible)
Visits an annotation of the class.
|
visit, visitAttribute, visitEnd, visitField, visitInnerClass, visitMethod, visitOuterClass, visitSource
public HasAnnotation(ClassVisitor v, Class<? extends Annotation> annotation)
public static boolean hasAnnotation(byte[] classBytes, Class<? extends Annotation> annotation)
classBytes
has a particular annotation.classBytes
- the class's bytecodeannotation
- the type of annotation to look fortrue
if the class defined in classBytes
possesses the desired annotationpublic boolean isFound()
public AnnotationVisitor visitAnnotation(String desc, boolean visible)
ClassVisitor
visitAnnotation
in class ClassVisitor
desc
- the class descriptor of the annotation class.visible
- true if the annotation is visible at runtime.Copyright © 2018. All rights reserved.