Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.TypeReference


    return decl;
  }
 
  private lombok.ast.VariableDefinition createVariableDefinition(List<AbstractVariableDeclaration> decls, Map<FlagKey, Object> params) {
    int dims = Integer.MAX_VALUE;
    TypeReference winner = null;
    for (AbstractVariableDeclaration decl : decls) {
      TypeReference tr = decl.type;
      int newDims = tr.dimensions();
      if (newDims < dims) {
        dims = newDims;
        winner = tr;
      }
      if (dims == 0) break;
View Full Code Here


        checkRefs(meth, scope);
      }
    }

    private void checkDecl(MethodDeclaration meth, ClassScope scope) {
      TypeReference returnType = meth.returnType;
      if (containsLong(returnType, scope)) {
        longAccessError(meth, "Type '" + typeString(returnType)
            + "' may not be returned from a JSNI method");
      }
View Full Code Here

      suppressWarningsStack.push(getSuppressedWarnings(typeDeclaration.annotations));
      return true;
    }

    private void checkDecl(MethodDeclaration meth, ClassScope scope) {
      TypeReference returnType = meth.returnType;
      if (containsLong(returnType, scope)) {
        longAccessError(meth, "Type '" + typeString(returnType)
            + "' may not be returned from a JSNI method");
      }
View Full Code Here

    // recursive method that finds the end position of a type reference with type parameters, e.g.,
    // Foo<T>.List<Bar<T>>
    private int findSourceEndTypeReference(TypeReference type, TypeReference[] typeParameters) {
        int end = type.sourceEnd();
        if (isNotEmpty(typeParameters)) {
            TypeReference lastNode = typeParameters[typeParameters.length - 1];
            if (lastNode instanceof ParameterizedQualifiedTypeReference) {
                TypeReference[][] typeArguments = ((ParameterizedQualifiedTypeReference) lastNode).typeArguments;
                end = findSourceEndTypeReference(lastNode, typeArguments[typeArguments.length - 1]);
            } else if (lastNode instanceof ParameterizedSingleTypeReference) {
                TypeReference[] typeArguments = ((ParameterizedSingleTypeReference) lastNode).typeArguments;
                end = findSourceEndTypeReference(lastNode, typeArguments);
            } else {
                end = typeParameters[typeParameters.length - 1].sourceEnd();
            }
            if (end == -1) {
                end = lastNode.sourceEnd();
            }
            end++; // increment end position to the the last '>'
        }
        return end;
    }
View Full Code Here

  private boolean resolveThrownTypes(TreeLogger logger, JAbstractMethod method,
      TypeReference[] jthrows) {
    if (jthrows != null) {
      for (int i = 0; i < jthrows.length; i++) {
        TypeReference jthrown = jthrows[i];
        if (!resolveThrownType(logger, method, jthrown)) {
          return false;
        }
      }
    }
View Full Code Here

      suppressWarningsStack.push(getSuppressedWarnings(typeDeclaration.annotations));
      return true;
    }

    private void checkDecl(MethodDeclaration meth, ClassScope scope) {
      TypeReference returnType = meth.returnType;
      if (containsLong(returnType, scope)) {
        longAccessError(meth, "Type '" + typeString(returnType)
            + "' may not be returned from a JSNI method");
      }
View Full Code Here

        } else if (type instanceof QualifiedType) {
          return resolveTypeBindingForName(((QualifiedType)type).getName());
        } else if (type instanceof NameQualifiedType){
          return resolveTypeBindingForName(((NameQualifiedType)type).getName());
        }
        TypeReference typeReference = (TypeReference) node;
        binding = typeReference.resolvedType;
      } else if (node instanceof SingleNameReference && ((SingleNameReference)node).isTypeReference()) {
        binding = (((SingleNameReference)node).resolvedType);
      } else if (node instanceof QualifiedNameReference && ((QualifiedNameReference)node).isTypeReference()) {
        binding = (((QualifiedNameReference)node).resolvedType);
View Full Code Here

      }
    }
    /*
     * Superclass
     */
    final TypeReference superclass = typeDeclaration.superclass;
    if (superclass != null) {
      Alignment superclassAlignment =this.scribe.createAlignment(
          Alignment.SUPER_CLASS,
          this.preferences.alignment_for_superclass_in_type_declaration,
          2,
          this.scribe.scanner.currentPosition);
      this.scribe.enterAlignment(superclassAlignment);
      boolean ok = false;
      do {
        try {
          this.scribe.alignFragment(superclassAlignment, 0);
          this.scribe.printNextToken(TerminalTokens.TokenNameextends, true);
          this.scribe.alignFragment(superclassAlignment, 1);
          this.scribe.space();
          superclass.traverse(this, typeDeclaration.scope);
          ok = true;
        } catch (AlignmentException e) {
          this.scribe.redoAlignment(e);
        }
      } while (!ok);
View Full Code Here

        this.scribe.printModifiers(annotationTypeMemberDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_METHOD);
    this.scribe.space();
    /*
     * Print the method return type
     */
    final TypeReference returnType = annotationTypeMemberDeclaration.returnType;
    final MethodScope annotationTypeMemberDeclarationScope = annotationTypeMemberDeclaration.scope;

    if (returnType != null) {
      returnType.traverse(this, annotationTypeMemberDeclarationScope);
    }
    /*
     * Print the method name
     */
    this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, true);
View Full Code Here

    }

    /*
     * Argument type
     */
    TypeReference argumentType = argument.type;
    if (argumentType != null) {
      if (argumentType instanceof UnionTypeReference) {
        formatMultiCatchArguments(
            argument,
            this.preferences.insert_space_before_binary_operator,
            this.preferences.insert_space_after_binary_operator,
            this.preferences.alignment_for_union_type_in_multicatch,
            scope);
      } else {
        argumentType.traverse(this, scope);
      }
    }

    if (argument.isVarArgs()) {
      Annotation [][] annotationsOnDimensions = argumentType.getAnnotationsOnDimensions(true);
      if (annotationsOnDimensions != null) {
        Annotation [] varargAnnotations = annotationsOnDimensions[annotationsOnDimensions.length - 1];
        if (varargAnnotations != null) {
          formatInlineAnnotations(varargAnnotations, true);
        }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.ast.TypeReference

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.