public final class ConstraintAnnotationVisitor extends AbstractElementVisitor<java.lang.Void,java.util.List<javax.lang.model.element.AnnotationMirror>>
ElementVisitor
that visits annotated elements (type declarations,
methods and fields) and applies different ConstraintCheck
s to them.
Each ConstraintCheckIssue
occurred will be reported using the
Messager
API.messager, verbose
Constructor and Description |
---|
ConstraintAnnotationVisitor(javax.annotation.processing.ProcessingEnvironment processingEnvironment,
MessagerAdapter messager,
Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
java.lang.Void |
visitExecutableAsMethod(javax.lang.model.element.ExecutableElement method,
java.util.List<javax.lang.model.element.AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given
method.
|
java.lang.Void |
visitTypeAsAnnotationType(javax.lang.model.element.TypeElement annotationType,
java.util.List<javax.lang.model.element.AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given
annotation type declaration.
|
java.lang.Void |
visitTypeAsClass(javax.lang.model.element.TypeElement e,
java.util.List<javax.lang.model.element.AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given
class type declaration.
|
java.lang.Void |
visitTypeAsEnum(javax.lang.model.element.TypeElement e,
java.util.List<javax.lang.model.element.AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given
enum type declaration.
|
java.lang.Void |
visitTypeAsInterface(javax.lang.model.element.TypeElement e,
java.util.List<javax.lang.model.element.AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given
interface type declaration.
|
java.lang.Void |
visitVariableAsField(javax.lang.model.element.VariableElement annotatedField,
java.util.List<javax.lang.model.element.AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given
field.
|
java.lang.Void |
visitVariableAsParameter(javax.lang.model.element.VariableElement annotatedField,
java.util.List<javax.lang.model.element.AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given
method parameter.
|
reportIssues
visitVariableAsResourceVariable
visitExecutable, visitExecutableAsConstructor, visitExecutableAsInstanceInit, visitExecutableAsStaticInit, visitPackage, visitType, visitTypeParameter, visitVariable, visitVariableAsEnumConstant, visitVariableAsExceptionParameter, visitVariableAsLocalVariable
public ConstraintAnnotationVisitor(javax.annotation.processing.ProcessingEnvironment processingEnvironment, MessagerAdapter messager, Configuration configuration)
public java.lang.Void visitExecutableAsMethod(javax.lang.model.element.ExecutableElement method, java.util.List<javax.lang.model.element.AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given method. The following checks are performed:
@Valid
annotation may only be given at non-static,
non-primitive JavaBeans getter methods.visitExecutableAsMethod
in class javax.lang.model.util.ElementKindVisitor6<java.lang.Void,java.util.List<javax.lang.model.element.AnnotationMirror>>
public java.lang.Void visitVariableAsField(javax.lang.model.element.VariableElement annotatedField, java.util.List<javax.lang.model.element.AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given field. The following checks are performed:
@Valid
annotation may only be given at non-static,
non-primitive fields.visitVariableAsField
in class javax.lang.model.util.ElementKindVisitor6<java.lang.Void,java.util.List<javax.lang.model.element.AnnotationMirror>>
public java.lang.Void visitVariableAsParameter(javax.lang.model.element.VariableElement annotatedField, java.util.List<javax.lang.model.element.AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given method parameter. The following checks are performed:
visitVariableAsParameter
in class javax.lang.model.util.ElementKindVisitor6<java.lang.Void,java.util.List<javax.lang.model.element.AnnotationMirror>>
public java.lang.Void visitTypeAsAnnotationType(javax.lang.model.element.TypeElement annotationType, java.util.List<javax.lang.model.element.AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given annotation type declaration. The following checks are performed:
visitTypeAsAnnotationType
in class javax.lang.model.util.ElementKindVisitor6<java.lang.Void,java.util.List<javax.lang.model.element.AnnotationMirror>>
public java.lang.Void visitTypeAsClass(javax.lang.model.element.TypeElement e, java.util.List<javax.lang.model.element.AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given class type declaration. The following checks are performed:
visitTypeAsClass
in class javax.lang.model.util.ElementKindVisitor6<java.lang.Void,java.util.List<javax.lang.model.element.AnnotationMirror>>
public java.lang.Void visitTypeAsEnum(javax.lang.model.element.TypeElement e, java.util.List<javax.lang.model.element.AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given enum type declaration. The following checks are performed:
visitTypeAsEnum
in class javax.lang.model.util.ElementKindVisitor6<java.lang.Void,java.util.List<javax.lang.model.element.AnnotationMirror>>
public java.lang.Void visitTypeAsInterface(javax.lang.model.element.TypeElement e, java.util.List<javax.lang.model.element.AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given interface type declaration. The following checks are performed:
visitTypeAsInterface
in class javax.lang.model.util.ElementKindVisitor6<java.lang.Void,java.util.List<javax.lang.model.element.AnnotationMirror>>
Copyright © 2007-2022 Red Hat, Inc. All Rights Reserved