public abstract class AbstractAnnotationVisitor extends Object implements AnnotationVisitor
Modifier and Type | Field and Description |
---|---|
protected Object |
target |
protected Class<?> |
targetClass |
Modifier | Constructor and Description |
---|---|
protected |
AbstractAnnotationVisitor(Class<? extends Annotation> ann) |
protected |
AbstractAnnotationVisitor(List<Class<? extends Annotation>> ann) |
Modifier and Type | Method and Description |
---|---|
protected void |
addTargetAnnotation(Class<? extends Annotation> ann) |
Object |
getTarget() |
List<Class<? extends Annotation>> |
getTargetAnnotations()
return the list of annotations this visitor wants to be
informed about.
|
Class<?> |
getTargetClass() |
void |
setTarget(Object object)
set the target object being visited.
|
void |
setTarget(Object object,
Class<?> cls) |
void |
visitClass(Class<?> clz,
Annotation annotation)
visit an annotated class.
|
void |
visitField(Field field,
Annotation annotation)
visit an annotated field.
|
void |
visitMethod(Method method,
Annotation annotation)
visit an annotated method.
|
protected AbstractAnnotationVisitor(Class<? extends Annotation> ann)
protected AbstractAnnotationVisitor(List<Class<? extends Annotation>> ann)
protected final void addTargetAnnotation(Class<? extends Annotation> ann)
public void visitClass(Class<?> clz, Annotation annotation)
AnnotationVisitor
visitClass
is called for each of the annotations
that matches and for each class.visitClass
in interface AnnotationVisitor
clz
- the class with the annotationannotation
- the annotationpublic List<Class<? extends Annotation>> getTargetAnnotations()
AnnotationVisitor
getTargetAnnotations
in interface AnnotationVisitor
public void visitField(Field field, Annotation annotation)
AnnotationVisitor
visitField
is called for each of the annotations
that matches and for each field.visitField
in interface AnnotationVisitor
field
- the annotated fieldannotation
- the annotationpublic void visitMethod(Method method, Annotation annotation)
AnnotationVisitor
visitMethod
is called for each of the annotations
that matches and for each method.visitMethod
in interface AnnotationVisitor
method
- the annotated fieldxannotation
- the annotationpublic void setTarget(Object object)
AnnotationVisitor
setTarget
in interface AnnotationVisitor
object
- the target objectAnnotationProcessor
public Object getTarget()
public Class<?> getTargetClass()
Copyright © 2019 JBoss by Red Hat. All rights reserved.