public interface Check extends Configurable
The methods on this interface are called in the following order:
initialize
setOldTypeEnvironment
setNewTypeEnvironment
(visitClass
(visitClass ... visitEnd)* //inner classes
(visitField
visitAnnotation*
visitEnd)*
(visitMethod
(visitMethodParameter
visitAnnotation*
visitEnd)*
visitAnnotation*
visitEnd)*
visitAnnotation*
visitEnd)*
Consider inheriting from the CheckBase instead of directly implementing this
interface because it takes care of matching the corresponding visit*() and visitEnd() calls.
| Modifier and Type | Method and Description |
|---|---|
void |
setNewTypeEnvironment(TypeEnvironment env)
The environment containing the new version of the classes.
|
void |
setOldTypeEnvironment(TypeEnvironment env)
The environment containing the old version of the classes.
|
List<Difference> |
visitAnnotation(AnnotationMirror oldAnnotation,
AnnotationMirror newAnnotation)
Visiting annotation is slightly different, because it is not followed by the standard
visitEnd() call. |
void |
visitClass(TypeElement oldType,
TypeElement newType) |
List<Difference> |
visitEnd()
Each of the other visit* calls is followed by a corresponding call to this method in a stack-like
manner.
|
void |
visitField(VariableElement oldField,
VariableElement newField) |
void |
visitMethod(ExecutableElement oldMethod,
ExecutableElement newMethod) |
void |
visitMethodParameter(VariableElement oldParameter,
VariableElement newParameter) |
getConfigurationRootPaths, getJSONSchema, initializevoid setOldTypeEnvironment(@Nonnull TypeEnvironment env)
Called once after the check has been instantiated.
env - the environment to obtain the helper objects using which one can navigate and examine typesvoid setNewTypeEnvironment(@Nonnull TypeEnvironment env)
Called once after the check has been instantiated.
env - the environment to obtain the helper objects using which one can navigate and examine types@Nullable List<Difference> visitEnd()
I.e. a series of calls might look like this:
visitClass();
visitMethod();
visitEnd();
visitMethod();
visitEnd();
visitEnd(); //"ends" the visitClass()
void visitClass(@Nullable TypeElement oldType, @Nullable TypeElement newType)
void visitMethod(@Nullable ExecutableElement oldMethod, @Nullable ExecutableElement newMethod)
void visitMethodParameter(@Nullable VariableElement oldParameter, @Nullable VariableElement newParameter)
void visitField(@Nullable VariableElement oldField, @Nullable VariableElement newField)
@Nullable List<Difference> visitAnnotation(@Nullable AnnotationMirror oldAnnotation, @Nullable AnnotationMirror newAnnotation)
visitEnd() call.
Instead, because visiting annotation is always "terminal" in a sense that an annotation doesn't have any child
elements, the list of differences is returned straight away.oldAnnotation - the annotation in the old APInewAnnotation - the annotation in the new APICopyright © 2015. All Rights Reserved.