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

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


    String packageName = String.valueOf(binding.fPackage.readableName());
    JPackage pkg = typeOracle.getOrCreatePackage(packageName);
    assert (pkg != null);

    CompilationUnitScope cus = (CompilationUnitScope) jclass.scope.parent;
    assert (cus != null);

    // Try to resolve annotations, ignore any that fail.
    Map<Class<? extends java.lang.annotation.Annotation>, java.lang.annotation.Annotation> declaredAnnotations = newAnnotationMap();
    resolveAnnotations(logger, cus.referenceContext.currentPackage.annotations,
View Full Code Here


  DefaultBindingResolver(LookupEnvironment lookupEnvironment, WorkingCopyOwner workingCopyOwner, BindingTables bindingTables, boolean isRecoveringBindings, boolean fromJavaProject) {
    this.newAstToOldAst = new HashMap();
    this.astNodesToBlockScope = new HashMap();
    this.bindingsToAstNodes = new HashMap();
    this.bindingTables = bindingTables;
    this.scope = new CompilationUnitScope(new CompilationUnitDeclaration(null, null, -1), lookupEnvironment);
    this.workingCopyOwner = workingCopyOwner;
    this.isRecoveringBindings = isRecoveringBindings;
    this.fromJavaProject = fromJavaProject;
  }
View Full Code Here

    assert (referencedFrom != null);
    assert (binding != null);

    if (binding instanceof SourceTypeBinding) {
      SourceTypeBinding type = (SourceTypeBinding) binding;
      CompilationUnitScope from = findUnitScope(referencedFrom);
      onTypeRef(type, from.referenceContext);
    } else if (binding instanceof ArrayBinding) {
      maybeDispatch(referencedFrom, expression,
          ((ArrayBinding) binding).leafComponentType);
    } else if (binding instanceof BinaryTypeBinding) {
      CompilationUnitScope from = findUnitScope(referencedFrom);
      onBinaryTypeRef((BinaryTypeBinding) binding, from.referenceContext,
          expression);
    } else if (binding instanceof ParameterizedTypeBinding) {
      // Make sure that we depend on the generic version of the class.
      ParameterizedTypeBinding ptBinding = (ParameterizedTypeBinding) binding;
View Full Code Here

    String packageName = String.valueOf(binding.fPackage.readableName());
    JPackage pkg = typeOracle.getOrCreatePackage(packageName);
    assert (pkg != null);

    CompilationUnitScope cus = (CompilationUnitScope) jclass.scope.parent;
    assert (cus != null);

    // Try to resolve annotations, ignore any that fail.
    Map<Class<? extends java.lang.annotation.Annotation>, java.lang.annotation.Annotation> declaredAnnotations = newAnnotationMap();
    resolveAnnotations(logger, cus.referenceContext.currentPackage.annotations,
View Full Code Here

    CompilationResult compilationResult = new CompilationResult(
        "TestCompilationUnit.java".toCharArray(), 0, 0, 0);
    CompilationUnitDeclaration cud = new CompilationUnitDeclaration(null,
        compilationResult, 1);
    LookupEnvironment lookupEnvironment = createMockLookupEnvironment();
    cud.scope = new CompilationUnitScope(cud, lookupEnvironment);

    TypeDeclaration typeDeclaration = new TypeDeclaration(compilationResult);
    typeDeclaration.scope = new ClassScope(cud.scope, null);
    typeDeclaration.staticInitializerScope = new MethodScope(
        typeDeclaration.scope, null, false);
View Full Code Here

    String packageName = String.valueOf(binding.fPackage.readableName());
    JPackage pkg = typeOracle.getOrCreatePackage(packageName);
    assert (pkg != null);

    CompilationUnitScope cus = (CompilationUnitScope) jclass.scope.parent;
    assert (cus != null);

    // Try to resolve annotations, ignore any that fail.
    Map<Class<? extends java.lang.annotation.Annotation>, java.lang.annotation.Annotation> declaredAnnotations = newAnnotationMap();
    resolveAnnotations(logger, cus.referenceContext.currentPackage.annotations,
View Full Code Here

           *   T elementVar = i$iterator.next();
           *   // user action
           * }
           * </pre>
           */
          CompilationUnitScope cudScope = scope.compilationUnitScope();
          ReferenceBinding javaUtilIterator = scope.getJavaUtilIterator();
          ReferenceBinding javaLangIterable = scope.getJavaLangIterable();
          MethodBinding iterator = javaLangIterable.getExactMethod(ITERATOR, NO_TYPES, cudScope);
          MethodBinding hasNext = javaUtilIterator.getExactMethod(HAS_NEXT, NO_TYPES, cudScope);
          MethodBinding next = javaUtilIterator.getExactMethod(NEXT, NO_TYPES, cudScope);
View Full Code Here

           *   T elementVar = i$iterator.next();
           *   // user action
           * }
           * </pre>
           */
          CompilationUnitScope cudScope = scope.compilationUnitScope();
          ReferenceBinding javaUtilIterator = scope.getJavaUtilIterator();
          ReferenceBinding javaLangIterable = scope.getJavaLangIterable();
          MethodBinding iterator = javaLangIterable.getExactMethod(ITERATOR, NO_TYPES, cudScope);
          MethodBinding hasNext = javaUtilIterator.getExactMethod(HAS_NEXT, NO_TYPES, cudScope);
          MethodBinding next = javaUtilIterator.getExactMethod(NEXT, NO_TYPES, cudScope);
View Full Code Here

  DefaultBindingResolver(LookupEnvironment lookupEnvironment, WorkingCopyOwner workingCopyOwner, BindingTables bindingTables, boolean isRecoveringBindings, boolean fromJavaProject) {
    this.newAstToOldAst = new HashMap();
    this.astNodesToBlockScope = new HashMap();
    this.bindingsToAstNodes = new HashMap();
    this.bindingTables = bindingTables;
    this.scope = new CompilationUnitScope(new CompilationUnitDeclaration(null, null, -1), lookupEnvironment);
    this.workingCopyOwner = workingCopyOwner;
    this.isRecoveringBindings = isRecoveringBindings;
    this.fromJavaProject = fromJavaProject;
  }
View Full Code Here

      if (packageBinding != null) return packageBinding;
    }
    if (this.innerTypeBinding != null && this.dimensions > 0) {
      return null;
    }
    CompilationUnitScope scope = this.resolver.scope();
    if (scope != null) {
      return this.resolver.getPackageBinding(scope.getCurrentPackage());
    }
    return null;
  }
View Full Code Here

TOP

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

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.