public abstract class AbstractAnnotationVisitor extends java.lang.Object implements AnnotationVisitor
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Object |
target |
protected java.lang.Class<?> |
targetClass |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAnnotationVisitor(java.lang.Class<? extends java.lang.annotation.Annotation> ann) |
protected |
AbstractAnnotationVisitor(java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> ann) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addTargetAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> ann) |
java.lang.Object |
getTarget() |
java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getTargetAnnotations()
return the list of annotations this visitor wants to be
informed about.
|
java.lang.Class<?> |
getTargetClass() |
void |
setTarget(java.lang.Object object)
set the target object being visited.
|
void |
setTarget(java.lang.Object object,
java.lang.Class<?> cls) |
void |
visitClass(java.lang.Class<?> clz,
java.lang.annotation.Annotation annotation)
visit an annotated class.
|
void |
visitField(java.lang.reflect.Field field,
java.lang.annotation.Annotation annotation)
visit an annotated field.
|
void |
visitMethod(java.lang.reflect.Method method,
java.lang.annotation.Annotation annotation)
visit an annotated method.
|
protected java.lang.Object target
protected java.lang.Class<?> targetClass
protected AbstractAnnotationVisitor(java.lang.Class<? extends java.lang.annotation.Annotation> ann)
protected AbstractAnnotationVisitor(java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> ann)
protected final void addTargetAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> ann)
public void visitClass(java.lang.Class<?> clz,
java.lang.annotation.Annotation annotation)
AnnotationVisitorvisitClass is called for each of the annotations
that matches and for each class.visitClass in interface AnnotationVisitorclz - the class with the annotationannotation - the annotationpublic java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> getTargetAnnotations()
AnnotationVisitorgetTargetAnnotations in interface AnnotationVisitorpublic void visitField(java.lang.reflect.Field field,
java.lang.annotation.Annotation annotation)
AnnotationVisitorvisitField is called for each of the annotations
that matches and for each field.visitField in interface AnnotationVisitorfield - the annotated fieldannotation - the annotationpublic void visitMethod(java.lang.reflect.Method method,
java.lang.annotation.Annotation annotation)
AnnotationVisitorvisitMethod is called for each of the annotations
that matches and for each method.visitMethod in interface AnnotationVisitormethod - the annotated fieldxannotation - the annotationpublic void setTarget(java.lang.Object object)
AnnotationVisitorsetTarget in interface AnnotationVisitorobject - the target objectAnnotationProcessorpublic void setTarget(java.lang.Object object,
java.lang.Class<?> cls)
public java.lang.Object getTarget()
public java.lang.Class<?> getTargetClass()