Package org.aspectj.weaver

Examples of org.aspectj.weaver.NewFieldTypeMunger


    addedSuperInitializers.put(onType, l);
    return true;
  }

  public void addInitializer(ConcreteTypeMunger cm) {
    NewFieldTypeMunger m = (NewFieldTypeMunger) cm.getMunger();
    ResolvedType onType = m.getSignature().getDeclaringType().resolve(world);
    if (onType.isRawType()) {
      onType = onType.getGenericType();
    }

    if (Modifier.isStatic(m.getSignature().getModifiers())) {
      addedClassInitializers.add(cm);
    } else {
      if (onType == ty.getResolvedTypeX()) {
        addedThisInitializers.add(cm);
      } else {
View Full Code Here


    }
    return subset;
  }

  public LazyMethodGen locateAnnotationHolderForFieldMunger(LazyClassGen clazz, ConcreteTypeMunger fieldMunger) {
    NewFieldTypeMunger newFieldMunger = (NewFieldTypeMunger) fieldMunger.getMunger();
    ResolvedMember lookingFor = AjcMemberMaker.interFieldInitializer(newFieldMunger.getSignature(), clazz.getType());
    for (LazyMethodGen method : clazz.getMethodGens()) {
      if (method.getName().equals(lookingFor.getName())) {
        return method;
      }
    }
View Full Code Here

        boolean itdMatch = false;
        List<ConcreteTypeMunger> lst = clazz.getType().getInterTypeMungers();
        for (Iterator<ConcreteTypeMunger> iterator = lst.iterator(); iterator.hasNext() && !itdMatch;) {
          ConcreteTypeMunger element = iterator.next();
          if (element.getMunger() instanceof NewFieldTypeMunger) {
            NewFieldTypeMunger nftm = (NewFieldTypeMunger) element.getMunger();
            itdMatch = declA.matches(nftm.getSignature(), world);
          } else if (element.getMunger() instanceof NewMethodTypeMunger) {
            NewMethodTypeMunger nmtm = (NewMethodTypeMunger) element.getMunger();
            itdMatch = declA.matches(nmtm.getSignature(), world);
          } else if (element.getMunger() instanceof NewConstructorTypeMunger) {
            NewConstructorTypeMunger nctm = (NewConstructorTypeMunger) element.getMunger();
View Full Code Here

    }

    InstructionList ret = new InstructionList();

    for (ConcreteTypeMunger cmunger : list) {
      NewFieldTypeMunger munger = (NewFieldTypeMunger) cmunger.getMunger();
      ResolvedMember initMethod = munger.getInitMethod(cmunger.getAspectType());
      if (!isStatic) {
        ret.append(InstructionConstants.ALOAD_0);
      }
      ret.append(Utility.createInvoke(fact, world, initMethod));
    }
View Full Code Here

    // if (returnType.isParameterizedType() || returnType.isGenericType()) returnType = returnType.getRawType();
    ResolvedMember sig = new ResolvedMemberImpl(Member.FIELD, declaringType, declaredModifiers, returnType, new String(
        declaredSelector), UnresolvedType.NONE);
    sig.setTypeVariables(sigtemp.getTypeVariables());

    NewFieldTypeMunger myMunger = new NewFieldTypeMunger(sig, null, typeVariableAliases);
    setMunger(myMunger);
    ResolvedType aspectType = world.fromEclipse(classScope.referenceContext.binding);
    ResolvedMember me = myMunger.getInitMethod(aspectType);
    this.selector = binding.selector = me.getName().toCharArray();
    this.realFieldType = this.binding.returnType;
    this.binding.returnType = TypeBinding.VOID;
    // ??? all other pieces should already match
View Full Code Here

    int codeAttributeOffset = classFile.contentsOffset;
    classFile.generateCodeAttributeHeader();
    CodeStream codeStream = classFile.codeStream;
    codeStream.reset(this, classFile);

    NewFieldTypeMunger fieldMunger = (NewFieldTypeMunger) munger;

        // Force use of version 1 if there is a field with that name on the type already
    if (world.getItdVersion() == 1) {
      fieldMunger.version = NewFieldTypeMunger.VersionOne;
    } else {
View Full Code Here

    addedSuperInitializers.put(onType, l);
    return true;
  }

  public void addInitializer(ConcreteTypeMunger cm) {
    NewFieldTypeMunger m = (NewFieldTypeMunger) cm.getMunger();
    ResolvedType onType = m.getSignature().getDeclaringType().resolve(world);
    if (onType.isRawType()) {
      onType = onType.getGenericType();
    }

    if (Modifier.isStatic(m.getSignature().getModifiers())) {
      addedClassInitializers.add(cm);
    } else {
      if (onType == ty.getResolvedTypeX()) {
        addedThisInitializers.add(cm);
      } else {
View Full Code Here

    }
    return subset;
  }

  public LazyMethodGen locateAnnotationHolderForFieldMunger(LazyClassGen clazz, ConcreteTypeMunger fieldMunger) {
    NewFieldTypeMunger newFieldMunger = (NewFieldTypeMunger) fieldMunger.getMunger();
    ResolvedMember lookingFor = AjcMemberMaker.interFieldInitializer(newFieldMunger.getSignature(), clazz.getType());
    for (LazyMethodGen method : clazz.getMethodGens()) {
      if (method.getName().equals(lookingFor.getName())) {
        return method;
      }
    }
View Full Code Here

        boolean itdMatch = false;
        List<ConcreteTypeMunger> lst = clazz.getType().getInterTypeMungers();
        for (Iterator<ConcreteTypeMunger> iterator = lst.iterator(); iterator.hasNext() && !itdMatch;) {
          ConcreteTypeMunger element = iterator.next();
          if (element.getMunger() instanceof NewFieldTypeMunger) {
            NewFieldTypeMunger nftm = (NewFieldTypeMunger) element.getMunger();
            itdMatch = declA.matches(nftm.getSignature(), world);
          } else if (element.getMunger() instanceof NewMethodTypeMunger) {
            NewMethodTypeMunger nmtm = (NewMethodTypeMunger) element.getMunger();
            itdMatch = declA.matches(nmtm.getSignature(), world);
          } else if (element.getMunger() instanceof NewConstructorTypeMunger) {
            NewConstructorTypeMunger nctm = (NewConstructorTypeMunger) element.getMunger();
View Full Code Here

    }

    InstructionList ret = new InstructionList();

    for (ConcreteTypeMunger cmunger : list) {
      NewFieldTypeMunger munger = (NewFieldTypeMunger) cmunger.getMunger();
      ResolvedMember initMethod = munger.getInitMethod(cmunger.getAspectType());
      if (!isStatic) {
        ret.append(InstructionConstants.ALOAD_0);
      }
      ret.append(Utility.createInvoke(fact, world, initMethod));
    }
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.NewFieldTypeMunger

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.