@Override public boolean hasDirectlyAnnotation(String canonicalName) { for (AnnotationExpr annotationExpr : wrappedNode.getAnnotations()) { if (solveType(annotationExpr.getName().getId(), typeSolver).getCorrespondingDeclaration().getQualifiedName().equals(canonicalName)) { return true; } } return false; }
@Override public boolean hasDirectlyAnnotation(String canonicalName) { for (AnnotationExpr annotationExpr : wrappedNode.getAnnotations()) { if (solveType(annotationExpr.getName().getId(), typeSolver).getCorrespondingDeclaration().getQualifiedName().equals(canonicalName)) { return true; } } return false; }
@Override public boolean hasDirectlyAnnotation(String canonicalName) { for (AnnotationExpr annotationExpr : wrappedNode.getAnnotations()) { if (solveType(annotationExpr.getName().getId(), typeSolver).getCorrespondingDeclaration().getQualifiedName().equals(canonicalName)) { return true; } } return false; }
@Override public boolean hasDirectlyAnnotation(String canonicalName) { for (AnnotationExpr annotationExpr : wrappedNode.getAnnotations()) { if (solveType(annotationExpr.getName().getId(), typeSolver).getCorrespondingDeclaration().getQualifiedName().equals(canonicalName)) { return true; } } return false; }
static boolean hasDirectlyAnnotation(NodeWithAnnotations<?> nodeWithAnnotations, TypeSolver typeSolver, String canonicalName) { for (AnnotationExpr annotationExpr : nodeWithAnnotations.getAnnotations()) { SymbolReference<ResolvedTypeDeclaration> ref = JavaParserFactory.getContext(annotationExpr, typeSolver) .solveType(annotationExpr.getName().getId()); if (ref.isSolved()) { if (ref.getCorrespondingDeclaration().getQualifiedName().equals(canonicalName)) { return true; } } else { throw new UnsolvedSymbolException(annotationExpr.getName().getId()); } } return false; }