Package org.aspectj.ajdt.internal.compiler.lookup

Examples of org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.fromBinding()


  }

  // PTWIMPL Generate getInstance method
  private void generatePerTypeWithinGetInstanceMethod(ClassFile classFile) {
    final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
    generateMethod(classFile, AjcMemberMaker.perTypeWithinGetInstance(world.fromBinding(binding)), new BodyGenerator() {
      public void generate(CodeStream codeStream) {
        ExceptionLabel exc = new ExceptionLabel(codeStream, world.makeTypeBinding(UnresolvedType.JL_EXCEPTION));
        exc.placeStart();
        codeStream.aload_0();
        codeStream.ldc(NameMangler.perTypeWithinLocalAspectOf(typeX));
View Full Code Here


    });
  }

  private void generatePerTypeWithinCreateAspectInstanceMethod(ClassFile classFile) {
    final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
    generateMethod(classFile, AjcMemberMaker.perTypeWithinCreateAspectInstance(world.fromBinding(binding)),
        new BodyGenerator() {
          public void generate(CodeStream codeStream) {

            codeStream.new_(world.makeTypeBinding(typeX));
            codeStream.dup();
View Full Code Here

    });
  }

  private void generatePerSingletonAjcClinitMethod(ClassFile classFile) {
    final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
    generateMethod(classFile, world.makeMethodBinding(AjcMemberMaker.ajcPostClinitMethod(world.fromBinding(binding))),
        new BodyGenerator() {
          public void generate(CodeStream codeStream) {
            // body starts here
            codeStream.new_(binding);
            codeStream.dup();
View Full Code Here

  }

  public void generateDispatchMethod(ClassScope classScope, ClassFile classFile) {
    EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(classScope);

    UnresolvedType aspectType = world.fromBinding(classScope.referenceContext.binding);
    ResolvedMember signature = munger.getSignature();

    ResolvedMember dispatchMember = AjcMemberMaker.interMethodDispatcher(signature, aspectType);
    MethodBinding dispatchBinding = world.makeMethodBinding(dispatchMember, munger.getTypeVariableAliases(), munger
        .getSignature().getDeclaringType());
View Full Code Here

        }
      }

      // XXX this is where we should remove unavailable args if we're in a cflow
      EclipseFactory factory = EclipseFactory.fromScopeLookupEnvironment(scope);
      ifPointcut.testMethod = new ResolvedMemberImpl(Member.METHOD, factory.fromBinding(binding.declaringClass),
          this.modifiers, ResolvedType.BOOLEAN, new String(this.selector), factory.fromBindings(this.binding.parameters));
    }
  }
}
View Full Code Here

    char[] accessName;
    if (call.isSuperAccess() && !call.binding.isStatic()) {
      call.receiver = new ThisReference(call.receiver.sourceStart, call.receiver.sourceEnd);
      accessName =
        NameMangler.superDispatchMethod(factory.fromBinding(targetClass),
              new String(superBinding.selector)).toCharArray();
    } else if (call.receiver.isThis() && call.binding.isProtected() && !call.binding.isStatic()) {
      //XXX this is a hack that violates some binary compatibility rules
      if (superBinding.declaringClass.equals(targetClass)) {
        accessName =
View Full Code Here

              new String(superBinding.selector)).toCharArray();
    } else if (call.receiver.isThis() && call.binding.isProtected() && !call.binding.isStatic()) {
      //XXX this is a hack that violates some binary compatibility rules
      if (superBinding.declaringClass.equals(targetClass)) {
        accessName =
          NameMangler.protectedDispatchMethod(factory.fromBinding(targetClass),
                new String(superBinding.selector)).toCharArray();
      } else {
        accessName =
        NameMangler.superDispatchMethod(factory.fromBinding(targetClass),
              new String(superBinding.selector)).toCharArray();
View Full Code Here

        accessName =
          NameMangler.protectedDispatchMethod(factory.fromBinding(targetClass),
                new String(superBinding.selector)).toCharArray();
      } else {
        accessName =
        NameMangler.superDispatchMethod(factory.fromBinding(targetClass),
              new String(superBinding.selector)).toCharArray();
      }
    } else {
      return;
    }
View Full Code Here

        FormalBinding[] bindings = new FormalBinding[baseArgumentCount];
        for (int i = 0, len = baseArgumentCount; i < len; i++) {
            Argument arg = arguments[i];
            String name = new String(arg.name);
            UnresolvedType type = world.fromBinding(parameters[i]);
            bindings[i] = new FormalBinding(type, name, i, arg.sourceStart, arg.sourceEnd, "unknown");
        }
       
        EclipseScope scope = new EclipseScope(bindings, dec.scope);
View Full Code Here

    if (hasPre) {
      final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(classScope);

      codeStream.invokestatic(world.makeMethodBindingForCall(
        AjcMemberMaker.ajcPreClinitMethod(
          world.fromBinding(classScope.referenceContext.binding)
        )));
    }
    super.generateSyntheticCode(classScope, codeStream);
  }
 
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.