Example usage for org.eclipse.jdt.core.dom DefaultBindingResolver getBinding

List of usage examples for org.eclipse.jdt.core.dom DefaultBindingResolver getBinding

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom DefaultBindingResolver getBinding.

Prototype

IBinding getBinding(org.eclipse.jdt.internal.compiler.lookup.Binding binding) 

Source Link

Usage

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

License:Open Source License

IBinding createBinding(String key) {
    if (this.bindingTables == null)
        throw new RuntimeException("Cannot be called outside ASTParser#createASTs(...)"); //$NON-NLS-1$
    BindingKeyResolver keyResolver = new BindingKeyResolver(key, this, this.lookupEnvironment);
    Binding compilerBinding = keyResolver.getCompilerBinding();
    if (compilerBinding == null)
        return null;
    DefaultBindingResolver resolver = new DefaultBindingResolver(this.lookupEnvironment, null/*no owner*/,
            this.bindingTables, false, this.fromJavaProject);
    return resolver.getBinding(compilerBinding);
}

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;/*  w ww .j  a v a  2 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;/* w  w w. j  a  v  a2 s  .co m*/
        if (annotationBinding != null) {
            binding = resolver.getAnnotationInstance(annotationBinding);
        } else {
            binding = resolver.getBinding(compilerBinding);
        }
        if (binding != null)
            astRequestor.acceptBinding(keyResolver.getKey(), binding);
    }
}