public void visitAnnotation(Element enclosingElement, AnnotationMirror e) { visitTypeReference(enclosingElement, e.getAnnotationType()); if (!e.getElementValues().isEmpty()) { Map<? extends ExecutableElement, ? extends AnnotationValue> values = e.getElementValues(); Set<? extends ExecutableElement> methodsSet = values.keySet(); List<ExecutableElement> methodsList = new ArrayList<>(); for (ExecutableElement method : methodsSet) { if (values.get(method) == null) { continue; } methodsList.add(method); } for (int i = 0; i < methodsList.size(); i++) { AnnotationValue value = values.get(methodsList.get(i)); visitAnnotationValue(enclosingElement, value); } } }
public void visitAnnotation(Element enclosingElement, AnnotationMirror e) { visitTypeReference(enclosingElement, e.getAnnotationType()); if (!e.getElementValues().isEmpty()) { Map<? extends ExecutableElement, ? extends AnnotationValue> values = e.getElementValues(); Set<? extends ExecutableElement> methodsSet = values.keySet(); List<ExecutableElement> methodsList = new ArrayList<>(); for (ExecutableElement method : methodsSet) { if (values.get(method) == null) { continue; } methodsList.add(method); } for (int i = 0; i < methodsList.size(); i++) { AnnotationValue value = values.get(methodsList.get(i)); visitAnnotationValue(enclosingElement, value); } } }
@Override public Void visitEnumConstant(VariableElement c, Void p) { visitTypeReference(enclosingElement, c.asType()); return null; }
@Override public Void visitExecutable(CodeExecutableElement e, Void p) { visitAnnotations(e, e.getAnnotationMirrors()); if (e.getReturnType() != null) { visitTypeReference(e, e.getReturnType()); } for (TypeMirror type : e.getThrownTypes()) { visitTypeReference(e, type); } return super.visitExecutable(e, p); }
@Override public Void visitEnumConstant(VariableElement c, Void p) { visitTypeReference(enclosingElement, c.asType()); return null; }
@Override public void visitTree(CodeTree e, Void p, Element enclosing) { if (e.getCodeKind() == CodeTreeKind.STATIC_FIELD_REFERENCE) { visitStaticFieldReference(enclosing, e.getType(), e.getString()); } else if (e.getCodeKind() == CodeTreeKind.STATIC_METHOD_REFERENCE) { visitStaticMethodReference(enclosing, e.getType(), e.getString()); } else if (e.getType() != null) { visitTypeReference(enclosing, e.getType()); } super.visitTree(e, p, enclosing); }
@Override public void visitTree(CodeTree e, Void p, Element enclosing) { if (e.getCodeKind() == CodeTreeKind.STATIC_FIELD_REFERENCE) { visitStaticFieldReference(enclosing, e.getType(), e.getString()); } else if (e.getCodeKind() == CodeTreeKind.STATIC_METHOD_REFERENCE) { visitStaticMethodReference(enclosing, e.getType(), e.getString()); } else if (e.getType() != null) { visitTypeReference(enclosing, e.getType()); } super.visitTree(e, p, enclosing); }
@Override public Void visitVariable(VariableElement f, Void p) { visitAnnotations(f, f.getAnnotationMirrors()); visitTypeReference(f, f.asType()); return super.visitVariable(f, p); }
@Override public Void visitType(TypeMirror t, Void p) { visitTypeReference(enclosingElement, t); return null; }
@Override public Void visitType(CodeTypeElement e, Void p) { visitAnnotations(e, e.getAnnotationMirrors()); visitTypeReference(e, e.getSuperclass()); for (TypeMirror type : e.getImplements()) { visitTypeReference(e, type); } return super.visitType(e, p); }
@Override public Void visitVariable(VariableElement f, Void p) { visitAnnotations(f, f.getAnnotationMirrors()); visitTypeReference(f, f.asType()); return super.visitVariable(f, p); }
@Override public Void visitType(TypeMirror t, Void p) { visitTypeReference(enclosingElement, t); return null; }
@Override public Void visitExecutable(CodeExecutableElement e, Void p) { visitAnnotations(e, e.getAnnotationMirrors()); if (e.getReturnType() != null) { visitTypeReference(e, e.getReturnType()); } for (TypeMirror type : e.getThrownTypes()) { visitTypeReference(e, type); } return super.visitExecutable(e, p); }
@Override public Void visitType(CodeTypeElement e, Void p) { visitAnnotations(e, e.getAnnotationMirrors()); visitTypeReference(e, e.getSuperclass()); for (TypeMirror type : e.getImplements()) { visitTypeReference(e, type); } return super.visitType(e, p); }