Example usage for org.eclipse.jdt.internal.core.util BindingKeyResolver getAnnotationBinding

List of usage examples for org.eclipse.jdt.internal.core.util BindingKeyResolver getAnnotationBinding

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.util BindingKeyResolver getAnnotationBinding.

Prototype

public AnnotationBinding getAnnotationBinding() 

Source Link

Usage

From source file:org.eclipse.jdt.core.dom.CompilationUnitResolver.java

License:Open Source License

private void reportBinding(Object key, ASTRequestor astRequestor, WorkingCopyOwner owner,
        CompilationUnitDeclaration unit) {
    BindingKeyResolver keyResolver = (BindingKeyResolver) key;
    Binding compilerBinding = keyResolver.getCompilerBinding();
    if (compilerBinding != null) {
        DefaultBindingResolver resolver = new DefaultBindingResolver(unit.scope, owner, this.bindingTables,
                false, this.fromJavaProject);
        AnnotationBinding annotationBinding = keyResolver.getAnnotationBinding();
        IBinding binding;//from w w  w.  ja v a2  s . c  om
        if (annotationBinding != null) {
            binding = resolver.getAnnotationInstance(annotationBinding);
        } else {
            binding = resolver.getBinding(compilerBinding);
        }
        if (binding != null)
            astRequestor.acceptBinding(keyResolver.getKey(), binding);
    }
}

From source file:org.eclipse.jdt.core.dom.CompilationUnitResolver.java

License:Open Source License

private void reportBinding(Object key, FileASTRequestor astRequestor, CompilationUnitDeclaration unit) {
    BindingKeyResolver keyResolver = (BindingKeyResolver) key;
    Binding compilerBinding = keyResolver.getCompilerBinding();
    if (compilerBinding != null) {
        DefaultBindingResolver resolver = new DefaultBindingResolver(unit.scope, null, this.bindingTables,
                false, this.fromJavaProject);
        AnnotationBinding annotationBinding = keyResolver.getAnnotationBinding();
        IBinding binding;/*from  ww  w  .  j  av a 2s . c  o m*/
        if (annotationBinding != null) {
            binding = resolver.getAnnotationInstance(annotationBinding);
        } else {
            binding = resolver.getBinding(compilerBinding);
        }
        if (binding != null)
            astRequestor.acceptBinding(keyResolver.getKey(), binding);
    }
}