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 (Iterator i = list.iterator(); i.hasNext();) {
      ConcreteTypeMunger cmunger = (ConcreteTypeMunger) i.next();
      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

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

   
    InstructionList ret = new InstructionList();
   
    for (Iterator i = list.iterator(); i.hasNext();) {
      ConcreteTypeMunger cmunger = (ConcreteTypeMunger) i.next();
      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));
    }
    return ret;
  }
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 (m.getSignature().isStatic()) {
      addedClassInitializers.add(cm);
    } else {
      if (onType == ty.getResolvedTypeX()) {
        addedThisInitializers.add(cm);
      } else {
View Full Code Here

    }
    return subset;
  }
 
  public LazyMethodGen locateAnnotationHolderForFieldMunger(LazyClassGen clazz,BcelTypeMunger fieldMunger) {
    NewFieldTypeMunger nftm = (NewFieldTypeMunger)fieldMunger.getMunger();
    ResolvedMember lookingFor =AjcMemberMaker.interFieldInitializer(nftm.getSignature(),clazz.getType());
    List meths = clazz.getMethodGens();
    for (Iterator iter = meths.iterator(); iter.hasNext();) {
      LazyMethodGen element = (LazyMethodGen) iter.next();
      if (element.getName().equals(lookingFor.getName())) return element;
    }
View Full Code Here

    ResolvedMember sigtemp = world.makeResolvedMemberForITD(binding,onTypeBinding,interTypeScope.getRecoveryAliases());
    ResolvedMember sig = new ResolvedMemberImpl(Member.FIELD,declaringType,declaredModifiers,
                          sigtemp.getReturnType(),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.VoidBinding;
    //??? all other pieces should already match
   
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.