Examples of TypeBinding


Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

    }
  }

 
  private boolean isRuntimeInvisible(Annotation annotation) {
    final TypeBinding annotationBinding = annotation.resolvedType;
    if (annotationBinding == null) {
      return false;
    }
    long metaTagBits = annotationBinding.getAnnotationTagBits(); // could be forward reference
    if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
      return true; // by default the retention is CLASS
     
    return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention;
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

     
    return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention;
  }

  private boolean isRuntimeVisible(Annotation annotation) {
    final TypeBinding annotationBinding = annotation.resolvedType;
    if (annotationBinding == null) {
      return false;
    }
    long metaTagBits = annotationBinding.getAnnotationTagBits();
    if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
      return false; // by default the retention is CLASS
     
    return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention;
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

            didAlreadyComplain = true;
          }
        }
      }
      // check for missing returning path
      TypeBinding returnTypeBinding = binding.returnType;
      if ((returnTypeBinding == TypeBinding.VOID) || isAbstract()) {
        if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) {
          this.bits |= ASTNode.NeedFreeReturn;
        }
      } else {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

      Wildcard w = (Wildcard) ref;
      if (w.bound == null) {
        handleSig.append('*');
      } else {
        handleSig.append('+');
        TypeBinding typeB = w.bound.resolvedType;
        if (typeB == null) {
          typeB = w.bound.resolveType(scope);
        }
        createHandleSigForReference(w.bound, typeB, scope, handleSig);
      }
    } else if (ref instanceof ParameterizedSingleTypeReference) {
      ParameterizedSingleTypeReference pstr = (ParameterizedSingleTypeReference) ref;
      for (int i = pstr.dimensions(); i > 0; i--) {
        handleSig.append("\\[");
      }
      handleSig.append('Q').append(pstr.token);
      TypeReference[] typeRefs = pstr.typeArguments;
      if (typeRefs != null && typeRefs.length > 0) {
        handleSig.append("\\<");
        for (int i = 0; i < typeRefs.length; i++) {
          TypeReference typeR = typeRefs[i];
          TypeBinding typeB = typeR.resolvedType;
          if (typeB == null) {
            typeB = typeR.resolveType(scope);
          }
          createHandleSigForReference(typeR, typeB, scope, handleSig);
        }
        handleSig.append('>');
      }
      handleSig.append(';');
    } else if (ref instanceof ArrayTypeReference) {
      ArrayTypeReference atr = (ArrayTypeReference) ref;
      for (int i = 0; i < atr.dimensions; i++) {
        handleSig.append("\\[");
      }
      TypeBinding typeB = atr.resolvedType;
      if (typeB == null) {
        typeB = atr.resolveType(scope);
      }
      if (typeB.leafComponentType().isBaseType()) {
        handleSig.append(tb.leafComponentType().signature());
      } else {
        handleSig.append('Q').append(atr.token).append(';');
      }
    } else if (ref instanceof SingleTypeReference) {
      SingleTypeReference str = (SingleTypeReference) ref;
      if (tb.isBaseType()) {
        handleSig.append(tb.signature());
      } else {
        handleSig.append('Q').append(str.token).append(';');
      }
    } else if (ref instanceof ParameterizedQualifiedTypeReference) {
      ParameterizedQualifiedTypeReference pstr = (ParameterizedQualifiedTypeReference) ref;
      char[][] tokens = pstr.tokens;
      for (int i = pstr.dimensions(); i > 0; i--) {
        handleSig.append("\\[");
      }
      handleSig.append('Q');
      for (int i = 0; i < tokens.length; i++) {
        if (i > 0) {
          handleSig.append('.');
        }
        handleSig.append(tokens[i]);
        TypeReference[] typeRefs = pstr.typeArguments[i];
        if (typeRefs != null && typeRefs.length > 0) {
          handleSig.append("\\<");
          for (int j = 0; j < typeRefs.length; j++) {
            TypeReference typeR = typeRefs[j];
            TypeBinding typeB = typeR.resolvedType;
            if (typeB == null) {
              typeB = typeR.resolveType(scope);
            }
            createHandleSigForReference(typeR, typeB, scope, handleSig);
          }
          handleSig.append('>');
        }
      }
      handleSig.append(';');
    } else if (ref instanceof ArrayQualifiedTypeReference) {
      ArrayQualifiedTypeReference atr = (ArrayQualifiedTypeReference) ref;
      for (int i = 0; i < atr.dimensions(); i++) {
        handleSig.append("\\[");
      }
      TypeBinding typeB = atr.resolvedType;
      if (typeB == null) {
        typeB = atr.resolveType(scope);
      }
      if (typeB.leafComponentType().isBaseType()) {
        handleSig.append(tb.leafComponentType().signature());
      } else {
        char[][] tokens = atr.tokens;
        handleSig.append('Q');
        for (int i = 0; i < tokens.length; i++) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

        String argName = new String(argArray[i].name);
        // String argType = "<UnknownType>"; // pr135052
        if (acceptArgument(argName, argArray[i].type.toString())) {
          TypeReference typeR = argArray[i].type;
          if (typeR != null && md.scope != null) {
            TypeBinding typeB = typeR.resolvedType;
            if (typeB == null) {
              typeB = typeR.resolveType(md.scope);
            }
            // This code will conjure up a 'P' style signature:
            // EclipseFactory factory = EclipseFactory.fromScopeLookupEnvironment(md.scope);
            // UnresolvedType ut = factory.fromBinding(typeB);
            // paramSigs.add(ut.getSignature().toCharArray());
            paramSigs.add(typeB.genericTypeSignature());
            String hsig = handleSigForReference(typeR, typeB, md.scope);
            if (hsig == null) {
              problemWithSourceRefs = true;
            } else {
              paramSourceRefs.add(hsig);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

    }
    if (this.extendedDimensions != 0) {
      scope.problemReporter().illegalExtendedDimensions(this);   
    }   
    if (this.binding == null) return;
    TypeBinding returnTypeBinding = this.binding.returnType;
    if (returnTypeBinding != null) {
       
      // annotation methods can only return base types, String, Class, enum type, annotation types and arrays of these
      checkAnnotationMethodType: {
        TypeBinding leafReturnType = returnTypeBinding.leafComponentType();
        if (returnTypeBinding.dimensions() <= 1) { // only 1-dimensional array permitted
          switch (leafReturnType.erasure().id) {
            case T_byte :
            case T_short :
            case T_char :
            case T_int :
            case T_long :
            case T_float :
            case T_double :
            case T_boolean :
            case T_JavaLangString :
            case T_JavaLangClass :
              break checkAnnotationMethodType;
          }
          if (leafReturnType.isEnum() || leafReturnType.isAnnotationType())
            break checkAnnotationMethodType;
        }
        scope.problemReporter().invalidAnnotationMemberType(this);
      }
      if (this.defaultValue != null) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

    String extraArgName = "";// maybeGetExtraArgName();
    FormalBinding[] ret = new FormalBinding[mDecl.arguments.length];
    for (int i = 0; i < mDecl.arguments.length; i++) {
      Argument arg = mDecl.arguments[i];
      String name = new String(arg.name);
      TypeBinding argTypeBinding = mDecl.binding.parameters[i];
      UnresolvedType type = factory.fromBinding(argTypeBinding);
      if (CharOperation.equals(joinPoint, argTypeBinding.signature())
          || CharOperation.equals(joinPointStaticPart, argTypeBinding.signature())
          || CharOperation.equals(joinPointEnclosingStaticPart, argTypeBinding.signature())
          || CharOperation.equals(proceedingJoinPoint, argTypeBinding.signature()) || name.equals(extraArgName)) {
        ret[i] = new FormalBinding.ImplicitFormalBinding(type, name, i);
      } else {
        ret[i] = new FormalBinding(type, name, i, arg.sourceStart, arg.sourceEnd);
      }
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

      if (as == null) {
        annotationTypes = ResolvedType.NONE;
      } else {
        annotationTypes = new ResolvedType[as.length];
        for (int a = 0; a < as.length; a++) {
          TypeBinding tb = as[a].type.resolveType(declaration.staticInitializerScope);
          if (tb == null) {
            annotationTypes[a] = ResolvedType.MISSING;
          } else {
            annotationTypes[a] = factory.fromTypeBindingToRTX(tb);
          }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

    }
  }

  private AnnotationValue generateElementValue(Expression defaultValue, TypeBinding memberValuePairReturnType) {
    Constant constant = defaultValue.constant;
    TypeBinding defaultValueBinding = defaultValue.resolvedType;
    if (defaultValueBinding == null) {
      throw new MissingImplementationException(
          "Please raise an AspectJ bug.  AspectJ does not know how to convert this annotation value [" + defaultValue
              + "]");
    } else {
      if (memberValuePairReturnType.isArrayType() && !defaultValueBinding.isArrayType()) {
        if (constant != null && constant != Constant.NotAConstant) {
          // Testcase for this clause is MultiProjectIncrementalTests.testAnnotations_pr262154()
          AnnotationValue av = EclipseAnnotationConvertor.generateElementValueForConstantExpression(defaultValue,
              defaultValueBinding);
          return new ArrayAnnotationValue(new AnnotationValue[] { av });
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

  public void endVisit(QualifiedNameReference ref, BlockScope scope) {
    if (ref.binding instanceof FieldBinding) {
      ref.binding = getAccessibleField((FieldBinding) ref.binding, ref.actualReceiverType);
    }
    if (ref.otherBindings != null && ref.otherBindings.length > 0) {
      TypeBinding receiverType;
      if (ref.binding instanceof FieldBinding) {
        receiverType = ((FieldBinding) ref.binding).type;
      } else if (ref.binding instanceof VariableBinding) {
        receiverType = ((VariableBinding) ref.binding).type;
      } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.