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

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


 
  public static Annotation createDeclareSoftAnnotation(String pointcutExpression, String exceptionType, int pos) {
    char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,declareSoft};
    long[] positions = new long[typeName.length];
    for (int i = 0; i < positions.length; i++) positions[i] = pos;
    TypeReference annType = new QualifiedTypeReference(typeName,positions);
    NormalAnnotation ann = new NormalAnnotation(annType,pos);
    Expression pcutExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
    Expression exExpr = new StringLiteral(exceptionType.toCharArray(),pos,pos,1);
    MemberValuePair[] mvps = new MemberValuePair[2];
    mvps[0] = new MemberValuePair("pointcut".toCharArray(),pos,pos,pcutExpr);
View Full Code Here


 
  public static Annotation createDeclareAnnAnnotation(String patternString, String annString, String kind, int pos) {
    char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,declareAnnotation};
    long[] positions = new long[typeName.length];
    for (int i = 0; i < positions.length; i++) positions[i] = pos;
    TypeReference annType = new QualifiedTypeReference(typeName,positions);
    NormalAnnotation ann = new NormalAnnotation(annType,pos);
    Expression pattExpr = new StringLiteral(patternString.toCharArray(),pos,pos,1);
    Expression annExpr = new StringLiteral(annString.toCharArray(),pos,pos,1);
    Expression kindExpr = new StringLiteral(kind.toCharArray(),pos,pos,1);
    MemberValuePair[] mvps = new MemberValuePair[3];
View Full Code Here

 
  public static Annotation createITDAnnotation(char[] targetTypeName, int modifiers, char[] name, int pos) {
    char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,itdAnnotation};
    long[] positions = new long[typeName.length];
    for (int i = 0; i < positions.length; i++) positions[i] = pos;
    TypeReference annType = new QualifiedTypeReference(typeName,positions);
    NormalAnnotation ann = new NormalAnnotation(annType,pos);
    Expression targetExpr = new StringLiteral(targetTypeName,pos,pos,1);
    Expression nameExpr = new StringLiteral(name,pos,pos,1);
    Expression modsExpr = new IntLiteral(Integer.toString(modifiers).toCharArray(),pos,pos);
    MemberValuePair[] mvps = new MemberValuePair[3];
View Full Code Here

  }
 
  private static Annotation makeSingleStringMemberAnnotation(char[][] name, int pos, String annValue) {
    long[] positions = new long[name.length];
    for (int i = 0; i < positions.length; i++) positions[i] = pos;
    TypeReference annType = new QualifiedTypeReference(name,positions);
    NormalAnnotation ann = new NormalAnnotation(annType,pos);
    Expression valueExpr = new StringLiteral(annValue.toCharArray(),pos,pos,1);
    MemberValuePair[] mvps = new MemberValuePair[1];
    mvps[0] = new MemberValuePair(value,pos,pos,valueExpr);
    ann.memberValuePairs = mvps;
View Full Code Here

    simpleName.internalSetIdentifier(new String(typeParameter.name));
    int start = typeParameter.sourceStart;
    int end = typeParameter.sourceEnd;
    simpleName.setSourceRange(start, end - start + 1);
    typeParameter2.setName(simpleName);
    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

        }
    return qualifiedName;
  }
 
  protected void setTypeNameForAnnotation(org.aspectj.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

    }
  }

  boolean foundReturnTypeProblem = false;
  if (!method.isConstructor()) {
    TypeReference returnType = methodDecl instanceof MethodDeclaration
      ? ((MethodDeclaration) methodDecl).returnType
      : null;
    if (returnType == null) {
      methodDecl.scope.problemReporter().missingReturnType(methodDecl);
      method.returnType = null;
      foundReturnTypeProblem = true;
    } else {
      TypeBinding methodType = returnType.resolveType(methodDecl.scope, true /* check bounds*/);
      if (methodType == null) {
        foundReturnTypeProblem = true;
      } else if (methodType.isArrayType() && ((ArrayBinding) methodType).leafComponentType == TypeBinding.VOID) {
        methodDecl.scope.problemReporter().returnTypeCannotBeVoidArray((MethodDeclaration) methodDecl);
        foundReturnTypeProblem = true;
View Full Code Here

      TypeReference[] boundRefs = typeParameter.bounds;
      if (boundRefs != null) {
        boolean checkSuperclass = typeVariable.firstBound == typeVariable.superclass;
        for (int j = 0, boundLength = boundRefs.length; j < boundLength; j++) {
          TypeReference typeRef = boundRefs[j];
          TypeBinding superType = typeRef.resolvedType;
          if (superType == null || !superType.isValidBinding()) continue;

          // check against superclass
          if (checkSuperclass)
View Full Code Here

    } while ((currentType = currentType.superclass()) != null && (currentType.tagBits & TagBits.HasNoMemberTypes) == 0);
  }

  // Perform deferred bound checks for parameterized type references (only done after hierarchy is connected)
  public void  checkParameterizedTypeBounds() {
    TypeReference superclass = referenceContext.superclass;
    if (superclass != null)
      superclass.checkBounds(this);

    TypeReference[] superinterfaces = referenceContext.superInterfaces;
    if (superinterfaces != null)
      for (int i = 0, length = superinterfaces.length; i < length; i++)
        superinterfaces[i].checkBounds(this);
View Full Code Here

      if (sourceType.isEnum() && compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) // do not connect if source < 1.5 as enum already got flagged as syntax error
        return connectEnumSuperclass();
      sourceType.superclass = getJavaLangObject();
      return !detectHierarchyCycle(sourceType, sourceType.superclass, null);
    }
    TypeReference superclassRef = referenceContext.superclass;
    ReferenceBinding superclass = findSupertype(superclassRef);
    if (superclass != null) { // is null if a cycle was detected cycle or a problem
      if (!superclass.isClass()) {
        problemReporter().superclassMustBeAClass(sourceType, superclassRef, superclass);
      } else if (superclass.isFinal()) {
View Full Code Here

TOP

Related Classes of org.aspectj.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.