public final class MethodSubstitutionVerifier extends AbstractVerifier
| Modifier and Type | Field and Description |
|---|---|
private static boolean |
DEBUG |
private static String |
ORIGINAL_IS_STATIC |
private static String |
ORIGINAL_METHOD_NAME |
private static String |
ORIGINAL_METHOD_NAME_DEFAULT |
private static String |
ORIGINAL_SIGNATURE |
private static String |
ORIGINAL_SIGNATURE_DEFAULT |
env| Constructor and Description |
|---|
MethodSubstitutionVerifier(ProcessingEnvironment env) |
| Modifier and Type | Method and Description |
|---|---|
private static TypeElement |
findEnclosingClass(Element element) |
Class<? extends Annotation> |
getAnnotationClass() |
private boolean |
isSubtype(TypeMirror t1,
TypeMirror t2)
Tests whether one type is a subtype of another.
|
private boolean |
isTypeCompatible(TypeMirror originalType,
TypeMirror substitutionType) |
private static boolean |
needsErasure(TypeMirror typeMirror) |
private ExecutableElement |
originalMethod(ExecutableElement substitutionMethod,
AnnotationMirror substitutionAnnotation,
TypeElement originalType,
String originalName,
TypeMirror[] originalSignature,
boolean isStatic) |
private static String |
originalName(ExecutableElement substituteMethod,
AnnotationMirror substitution) |
private TypeMirror[] |
originalSignature(TypeElement originalType,
ExecutableElement method,
AnnotationMirror annotation,
boolean isStatic) |
void |
verify(Element element,
AnnotationMirror annotation) |
findAnnotationValue, resolveAnnotationValueprivate static final boolean DEBUG
private static final String ORIGINAL_METHOD_NAME
private static final String ORIGINAL_IS_STATIC
private static final String ORIGINAL_SIGNATURE
private static final String ORIGINAL_METHOD_NAME_DEFAULT
private static final String ORIGINAL_SIGNATURE_DEFAULT
public MethodSubstitutionVerifier(ProcessingEnvironment env)
public Class<? extends Annotation> getAnnotationClass()
getAnnotationClass in class AbstractVerifierpublic void verify(Element element, AnnotationMirror annotation)
verify in class AbstractVerifierprivate TypeMirror[] originalSignature(TypeElement originalType, ExecutableElement method, AnnotationMirror annotation, boolean isStatic)
private static String originalName(ExecutableElement substituteMethod, AnnotationMirror substitution)
private ExecutableElement originalMethod(ExecutableElement substitutionMethod, AnnotationMirror substitutionAnnotation, TypeElement originalType, String originalName, TypeMirror[] originalSignature, boolean isStatic)
private boolean isTypeCompatible(TypeMirror originalType, TypeMirror substitutionType)
private boolean isSubtype(TypeMirror t1, TypeMirror t2)
t1 - the first typet2 - the second typetrue if and only if the first type is a subtype of the secondprivate static boolean needsErasure(TypeMirror typeMirror)
private static TypeElement findEnclosingClass(Element element)