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

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


        validateAspectDeclaration(typeDecl);
      } else {
        // check that class doesn't extend aspect
        TypeReference parentRef = typeDecl.superclass;
        if (parentRef != null) {
          TypeBinding parentBinding = parentRef.resolvedType;
          if (parentBinding instanceof SourceTypeBinding) {
            SourceTypeBinding parentSTB = (SourceTypeBinding) parentBinding;
            if (parentSTB.scope != null) {
              TypeDeclaration parentDecl = parentSTB.scope.referenceContext;
              if (isAspect(parentDecl)) {
View Full Code Here

//            typeDecl.scope.problemReporter().signalError(typeDecl.sourceStart,typeDecl.sourceEnd,"@Aspect class must be public");
//        }

        TypeReference parentRef = typeDecl.superclass;
    if (parentRef != null) {
      TypeBinding parentBinding = parentRef.resolvedType;
      if (parentBinding instanceof SourceTypeBinding) {
        SourceTypeBinding parentSTB = (SourceTypeBinding) parentBinding;
        if (parentSTB.scope!=null) { // scope is null if its a binarytypebinding (in AJ world, thats a subclass of SourceTypeBinding)
          TypeDeclaration parentDecl = parentSTB.scope.referenceContext;
          if (isAspect(parentDecl) && !Modifier.isAbstract(parentDecl.modifiers)) {
View Full Code Here

    if (extraArgName == null) extraArgName = "";
    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, "unknown");           
      }
View Full Code Here

    checkInvocationArguments(scope,null,this.actualReceiverType,binding,
        this.arguments,binding.parameters,argsContainCast,this);

    for (int i=0, len=arguments.length; i < len; i++) {
      Expression arg = arguments[i];
      TypeBinding argType = arg.resolveType(scope);
      if (argType != null) {
        TypeBinding paramType = binding.parameters[i];
        if (!argType.isCompatibleWith(paramType)) {
          scope.problemReporter().typeMismatchError(argType, paramType, arg);
        }
      }
    }
View Full Code Here

 
  public static void generateParameterLoads(TypeBinding[] parameters, CodeStream codeStream) {
    int paramIndex = 0;
    int varIndex = 0;
    while (paramIndex < parameters.length) {
      TypeBinding param = parameters[paramIndex++];
      codeStream.load(param, varIndex);
      varIndex += slotsNeeded(param);
    }
  }
View Full Code Here

      generatePerCflowAspectOfMethod(classFile);
      generatePerCflowHasAspectMethod(classFile);
      generatePerCflowPushMethod(classFile);
      generatePerCflowAjcClinitMethod(classFile);
    } else if (perClause.getKind() == PerClause.PEROBJECT) {
      TypeBinding interfaceType =
        generatePerObjectInterface(classFile);
      world.addTypeBinding(interfaceType);
      generatePerObjectAspectOfMethod(classFile, interfaceType);
      generatePerObjectHasAspectMethod(classFile, interfaceType);
      generatePerObjectBindMethod(classFile, interfaceType);
View Full Code Here

    modifiers = checkAndSetModifiers(modifiers, upperScope);
    int bindingModifiers = (modifiers | (binding.modifiers & AccGenericSignature));
    binding.modifiers = bindingModifiers;
   
    if (kind == AdviceKind.AfterThrowing && extraArgument != null) {
      TypeBinding argTb = extraArgument.binding.type;
      TypeBinding expectedTb = upperScope.getJavaLangThrowable();
      if (!argTb.isCompatibleWith(expectedTb)) {
        scope.problemReporter().typeMismatchError(argTb, expectedTb, extraArgument);
        ignoreFurtherInvestigation = true;
        return;
      }
View Full Code Here

                1,
                classScope.environment()));
   
    int index = 0;
    for (int i=0; i < nargs-1; i++) {
      TypeBinding type = binding.parameters[i];
      codeStream.dup();
      codeStream.generateInlinedValue(i);
      codeStream.load(type, index);
      index += AstUtil.slotsNeeded(type);
      if (type.isBaseType()) {
        codeStream.invokestatic(AjTypeConstants.getConversionMethodToObject(classScope, type));
      }
     
      codeStream.aastore();
    }
   
    // call run
    ReferenceBinding closureType = (ReferenceBinding)binding.parameters[nargs-1];
    MethodBinding runMethod = closureType.getMethods("run".toCharArray())[0];
    codeStream.invokevirtual(runMethod);

    TypeBinding returnType = binding.returnType;
    if (returnType.isBaseType()) {
      codeStream.invokestatic(AjTypeConstants.getConversionMethodFromObject(classScope, returnType));
    } else {
      codeStream.checkcast(returnType);
    }
    AstUtil.generateReturn(returnType, codeStream);
View Full Code Here

      UnresolvedType.NONE);
  }
 
  public TypeBinding makeTypeBinding(UnresolvedType typeX) {
   
    TypeBinding ret = null;
   
    // looking up type variables can get us into trouble
    if (!typeX.isTypeVariableReference()) {
      if (typeX.isRawType()) {
        ret = (TypeBinding)rawTypeXToBinding.get(typeX);
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding

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.