Example usage for org.eclipse.jdt.internal.compiler.lookup PackageBinding getAnnotations

List of usage examples for org.eclipse.jdt.internal.compiler.lookup PackageBinding getAnnotations

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.lookup PackageBinding getAnnotations.

Prototype

public AnnotationBinding[] getAnnotations() 

Source Link

Usage

From source file:com.android.tools.lint.psi.EcjPsiPackage.java

License:Apache License

@SuppressWarnings("SameParameterValue")
private PsiAnnotation[] findAnnotations(boolean includeSuper) {
    List<PsiAnnotation> all = Lists.newArrayListWithExpectedSize(4);
    ExternalAnnotationRepository manager = mManager.getAnnotationRepository();

    PackageBinding binding = this.mPackageBinding;
    AnnotationBinding[] annotations = binding.getAnnotations();
    int count = annotations.length;
    if (count > 0) {
        for (AnnotationBinding annotation : annotations) {
            if (annotation != null) {
                all.add(new EcjPsiBinaryAnnotation(mManager, this, annotation));
            }/*from w w w .  j av a2 s.  com*/
        }
    }

    // Look for external annotations
    if (manager != null) {
        Collection<PsiAnnotation> external = manager.getAnnotations(binding);
        if (external != null) {
            all.addAll(external);
        }
    }

    return EcjPsiManager.ensureUnique(all);
}