Search in sources :

Example 21 with IAnnotationBinding

use of org.eclipse.jdt.core.dom.IAnnotationBinding in project eclipse.jdt.ls by eclipse.

the class TypeAnnotationRewrite method isPureTypeAnnotation.

private static boolean isPureTypeAnnotation(Annotation annotation) {
    IAnnotationBinding binding = annotation.resolveAnnotationBinding();
    if (binding == null) {
        return false;
    }
    IAnnotationBinding targetAnnotationBinding = findTargetAnnotation(binding.getAnnotationType().getAnnotations());
    if (targetAnnotationBinding == null) {
        return false;
    }
    return isTypeUseOnly(targetAnnotationBinding);
}
Also used : IAnnotationBinding(org.eclipse.jdt.core.dom.IAnnotationBinding)

Aggregations

IAnnotationBinding (org.eclipse.jdt.core.dom.IAnnotationBinding)21 ITypeBinding (org.eclipse.jdt.core.dom.ITypeBinding)14 ArrayType (org.eclipse.jdt.core.dom.ArrayType)6 PrimitiveType (org.eclipse.jdt.core.dom.PrimitiveType)6 Type (org.eclipse.jdt.core.dom.Type)6 Annotation (org.eclipse.jdt.core.dom.Annotation)5 ArrayList (java.util.ArrayList)4 ASTNode (org.eclipse.jdt.core.dom.ASTNode)4 Dimension (org.eclipse.jdt.core.dom.Dimension)4 InternalEList (org.eclipse.emf.ecore.util.InternalEList)3 IJavaProject (org.eclipse.jdt.core.IJavaProject)3 IExtendedModifier (org.eclipse.jdt.core.dom.IExtendedModifier)3 IVariableBinding (org.eclipse.jdt.core.dom.IVariableBinding)3 MethodDeclaration (org.eclipse.jdt.core.dom.MethodDeclaration)3 ParameterizedType (org.eclipse.jdt.core.dom.ParameterizedType)3 SingleVariableDeclaration (org.eclipse.jdt.core.dom.SingleVariableDeclaration)3 UnionType (org.eclipse.jdt.core.dom.UnionType)3 List (java.util.List)2 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)2 IJavaElement (org.eclipse.jdt.core.IJavaElement)2