Package org.eclipse.jdt.internal.compiler.lookup

Examples of org.eclipse.jdt.internal.compiler.lookup.Binding


          org.eclipse.jdt.internal.core.util.Util.log(e, "Could not retrieve declaring class"); //$NON-NLS-1$
        }
      }
    } else if (this.binding.isTypeVariable()) {
      TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
      Binding declaringElement = typeVariableBinding.isCapture() ? ((CaptureBinding) typeVariableBinding).sourceType : typeVariableBinding.declaringElement;
      if (declaringElement instanceof ReferenceBinding) {
        try {
          return this.resolver.getTypeBinding((ReferenceBinding)declaringElement);
        } catch (RuntimeException e) {
          /* in case a method cannot be resolvable due to missing jars on the classpath
View Full Code Here


      } else {
        return !referenceBinding.isBinaryBinding();
      }
    } else if (isTypeVariable()) {
      final TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
      final Binding declaringElement = typeVariableBinding.declaringElement;
      if (declaringElement instanceof MethodBinding) {
        MethodBinding methodBinding = (MethodBinding) declaringElement;
        return !methodBinding.declaringClass.isBinaryBinding();
      } else {
        final org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding = (org.eclipse.jdt.internal.compiler.lookup.TypeBinding) declaringElement;
View Full Code Here

  }

  public void consumeAnnotation() {
    int size = this.types.size();
    if (size == 0) return;
    Binding annotationType = ((BindingKeyResolver) this.types.get(size-1)).compilerBinding;
    AnnotationBinding[] annotationBindings;
    if (this.compilerBinding == null && this.typeBinding instanceof ReferenceBinding) {
      annotationBindings = ((ReferenceBinding) this.typeBinding).getAnnotations();
    } else if (this.compilerBinding instanceof MethodBinding) {
      annotationBindings = ((MethodBinding) this.compilerBinding).getAnnotations();
View Full Code Here

  }

  public void consumeCapture(final int position) {
    CompilationUnitDeclaration outerParsedUnit = this.outerMostParsedUnit == null ? this.parsedUnit : this.outerMostParsedUnit;
    if (outerParsedUnit == null) return;
    final Binding wildcardBinding = ((BindingKeyResolver) this.types.get(0)).compilerBinding;
    class CaptureFinder extends ASTVisitor {
      CaptureBinding capture;
      boolean checkType(TypeBinding binding) {
        if (binding == null)
          return false;
View Full Code Here

      case Wildcard.EXTENDS:
      case Wildcard.SUPER:
        BindingKeyResolver boundResolver = (BindingKeyResolver) this.types.get(0);
        // https://bugs.eclipse.org/bugs/show_bug.cgi?id=157847, do not allow creation of
        // internally inconsistent wildcards of the form '? super <null>' or '? extends <null>'
        final Binding boundBinding = boundResolver.compilerBinding;
        if (boundBinding instanceof TypeBinding) {
          this.typeBinding = this.environment.createWildcard((ReferenceBinding) this.typeBinding, this.wildcardRank, (TypeBinding) boundBinding, null /*no extra bound*/, kind);
        } else {
          this.typeBinding = null;
        }
View Full Code Here

}
protected void matchLevelAndReportImportRef(ImportReference importRef, Binding binding, MatchLocator locator) throws CoreException {

  // for static import, binding can be a field binding or a member type binding
  // verify that in this case binding is static and use declaring class for fields
  Binding refBinding = binding;
  if (importRef.isStatic()) {
    if (binding instanceof FieldBinding) {
      FieldBinding fieldBinding = (FieldBinding) binding;
      if (!fieldBinding.isStatic()) return;
      refBinding = fieldBinding.declaringClass;
View Full Code Here

      DefaultBindingResolver resolver = new DefaultBindingResolver(this.lookupEnvironment, null, this.bindingTables, (flags & ICompilationUnit.ENABLE_BINDINGS_RECOVERY) != 0, true);
      Object[] keys = this.requestedKeys.valueTable;
      for (int j = 0, keysLength = keys.length; j < keysLength; j++) {
        BindingKeyResolver keyResolver = (BindingKeyResolver) keys[j];
        if (keyResolver == null) continue;
        Binding compilerBinding = keyResolver.getCompilerBinding();
        IBinding binding = compilerBinding == null ? null : resolver.getBinding(compilerBinding);
        // pass it to requestor
        astRequestor.acceptBinding(((BindingKeyResolver) this.requestedKeys.valueTable[j]).getKey(), binding);
        worked(1);
      }
View Full Code Here

    }
  }

  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;
      if (annotationBinding != null) {
View Full Code Here

    }
  }

  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;
      if (annotationBinding != null) {
View Full Code Here

  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);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.lookup.Binding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.