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

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


    if (annotations != null) {
      if (annotations[0] != null)
        annotationsStart = annotations[0].sourceStart;
      annotateTypeParameter(typeParameter2, typeParameter.annotations);
    }
    final TypeReference superType = typeParameter.type;
    end = typeParameter.declarationSourceEnd;
    if (superType != null) {
      Type type = convertType(superType);
      typeParameter2.typeBounds().add(type);
      end = type.getStartPosition() + type.getLength() - 1;
View Full Code Here


    name.internalSetIdentifier(new String(localDeclaration.name));
    int start = localDeclaration.sourceStart;
    int nameEnd = localDeclaration.sourceEnd;
    name.setSourceRange(start, nameEnd - start + 1);
    variableDecl.setName(name);
    TypeReference typeReference = localDeclaration.type;
    final int extraDimensions = typeReference.extraDimensions();
    if (this.ast.apiLevel >= AST.JLS8) {
      setExtraAnnotatedDimensions(nameEnd + 1, localDeclaration.declarationSourceEnd, typeReference,
          variableDecl.extraDimensions(), extraDimensions);
    } else {
      internalSetExtraDimensions(variableDecl, extraDimensions);
View Full Code Here

    name.internalSetIdentifier(new String(fieldDeclaration.name));
    name.setSourceRange(fieldDeclaration.sourceStart, fieldDeclaration.sourceEnd - fieldDeclaration.sourceStart + 1);
    variableDeclarationFragment.setName(name);
    int start = fieldDeclaration.sourceEnd;
    int end = start;
    TypeReference typeReference = fieldDeclaration.type;
    int extraDimensions = typeReference.extraDimensions();
    if (this.ast.apiLevel >= AST.JLS8) {
      setExtraAnnotatedDimensions(fieldDeclaration.sourceEnd + 1, fieldDeclaration.declarationSourceEnd,
          typeReference, variableDeclarationFragment.extraDimensions(), extraDimensions);
    } else {
      internalSetExtraDimensions(variableDeclarationFragment, extraDimensions);
View Full Code Here

    name.internalSetIdentifier(new String(localDeclaration.name));
    name.setSourceRange(localDeclaration.sourceStart, localDeclaration.sourceEnd - localDeclaration.sourceStart + 1);
    variableDeclarationFragment.setName(name);
    int start = localDeclaration.sourceEnd;
    org.eclipse.jdt.internal.compiler.ast.Expression initialization = localDeclaration.initialization;
    TypeReference typeReference = localDeclaration.type;
    int extraDimension = typeReference.extraDimensions();
    if (this.ast.apiLevel >= AST.JLS8) {
      setExtraAnnotatedDimensions(localDeclaration.sourceEnd + 1, this.compilationUnitSourceLength,
          typeReference, variableDeclarationFragment.extraDimensions(), extraDimension);
    } else {
      internalSetExtraDimensions(variableDeclarationFragment, extraDimension);
View Full Code Here

          if (annotations != null && (fieldDeclaration.bits & ASTNode.HasTypeAnnotations) != 0) {
            fieldDeclaration.getAllAnnotationContexts(AnnotationTargetTypeConstants.FIELD, allTypeAnnotationContexts);
          }
          int invisibleTypeAnnotationsCounter = 0;
          int visibleTypeAnnotationsCounter = 0;
          TypeReference fieldType = fieldDeclaration.type;
          if (fieldType != null && ((fieldType.bits & ASTNode.HasTypeAnnotations) != 0)) {
            fieldType.getAllAnnotationContexts(AnnotationTargetTypeConstants.FIELD, allTypeAnnotationContexts);
          }
          int size = allTypeAnnotationContexts.size();
          if (size != 0) {
            AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[size];
            allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
View Full Code Here

        if (annotations != null && !methodDeclaration.isClinit() && (methodDeclaration.isConstructor() || binding.returnType.id != T_void)) {
          methodDeclaration.getAllAnnotationContexts(AnnotationTargetTypeConstants.METHOD_RETURN, allTypeAnnotationContexts);
        }
        if (!methodDeclaration.isConstructor() && !methodDeclaration.isClinit() && binding.returnType.id != T_void) {
          MethodDeclaration declaration = (MethodDeclaration) methodDeclaration;
          TypeReference typeReference = declaration.returnType;
          if ((typeReference.bits & ASTNode.HasTypeAnnotations) != 0) {
            typeReference.getAllAnnotationContexts(AnnotationTargetTypeConstants.METHOD_RETURN, allTypeAnnotationContexts);
          }
        }
        TypeReference[] thrownExceptions = methodDeclaration.thrownExceptions;
        if (thrownExceptions != null) {
          for (int i = 0, max = thrownExceptions.length; i < max; i++) {
            TypeReference thrownException = thrownExceptions[i];
            thrownException.getAllAnnotationContexts(AnnotationTargetTypeConstants.THROWS, i, allTypeAnnotationContexts);
          }
        }
        TypeParameter[] typeParameters = methodDeclaration.typeParameters();
        if (typeParameters != null) {
          for (int i = 0, max = typeParameters.length; i < max; i++) {
View Full Code Here

      return 0;
    }
    int attributesNumber = 0;
    int visibleTypeAnnotationsCounter = 0;
    int invisibleTypeAnnotationsCounter = 0;
    TypeReference superclass = typeDeclaration.superclass;
    List allTypeAnnotationContexts = new ArrayList();
    if (superclass != null && (superclass.bits & ASTNode.HasTypeAnnotations) != 0) {
      superclass.getAllAnnotationContexts(AnnotationTargetTypeConstants.CLASS_EXTENDS, -1, allTypeAnnotationContexts);
    }
    TypeReference[] superInterfaces = typeDeclaration.superInterfaces;
    if (superInterfaces != null) {
      for (int i = 0; i < superInterfaces.length; i++) {
        TypeReference superInterface = superInterfaces[i];
        if ((superInterface.bits & ASTNode.HasTypeAnnotations) == 0) {
          continue;
        }
        superInterface.getAllAnnotationContexts(AnnotationTargetTypeConstants.CLASS_EXTENDS, i, allTypeAnnotationContexts);
      }
    }
    TypeParameter[] typeParameters = typeDeclaration.typeParameters;
    if (typeParameters != null) {
      for (int i = 0, max = typeParameters.length; i < max; i++) {
View Full Code Here

        }
    return qualifiedName;
  }

  protected void setTypeNameForAnnotation(org.eclipse.jdt.internal.compiler.ast.Annotation compilerAnnotation, Annotation annotation) {
    TypeReference typeReference = compilerAnnotation.type;
    if (typeReference instanceof QualifiedTypeReference) {
      QualifiedTypeReference qualifiedTypeReference = (QualifiedTypeReference) typeReference;
      char[][] tokens = qualifiedTypeReference.tokens;
      long[] positions = qualifiedTypeReference.sourcePositions;
      // QualifiedName
View Full Code Here

    }
  }
  return interfaceNames;
}
protected char[] getSuperclassName(TypeDeclaration typeDeclaration) {
  TypeReference superclass = typeDeclaration.superclass;
  return superclass != null ? CharOperation.concatWith(superclass.getParameterizedTypeName(), '.') : null;
}
View Full Code Here

    }
  }
  return thrownExceptionTypes;
}
protected char[][] getTypeParameterBounds(TypeParameter typeParameter) {
  TypeReference firstBound = typeParameter.type;
  TypeReference[] otherBounds = typeParameter.bounds;
  char[][] typeParameterBounds = null;
  if (firstBound != null) {
    if (otherBounds != null) {
      int otherBoundsLength = otherBounds.length;
      char[][] boundNames = new char[otherBoundsLength+1][];
      boundNames[0] = CharOperation.concatWith(firstBound.getParameterizedTypeName(), '.');
      for (int j = 0; j < otherBoundsLength; j++) {
        boundNames[j+1] =
          CharOperation.concatWith(otherBounds[j].getParameterizedTypeName(), '.');
      }
      typeParameterBounds = boundNames;
    } else {
      typeParameterBounds = new char[][] { CharOperation.concatWith(firstBound.getParameterizedTypeName(), '.')};
    }
  } else {
    typeParameterBounds = CharOperation.NO_CHAR_CHAR;
  }
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.