Package org.aspectj.weaver

Examples of org.aspectj.weaver.ConcreteTypeMunger


    }
    // was: List l = typeToCheck.getInterTypeMungers();
    List<ConcreteTypeMunger> l = (typeToCheck.isRawType() ? typeToCheck.getGenericType().getInterTypeMungers() : typeToCheck
        .getInterTypeMungers());
    for (Iterator<ConcreteTypeMunger> iterator = l.iterator(); iterator.hasNext();) {
      ConcreteTypeMunger o = iterator.next();
      // FIXME asc if its not a BcelTypeMunger then its an
      // EclipseTypeMunger ... do I need to worry about that?
      if (o instanceof BcelTypeMunger) {
        BcelTypeMunger element = (BcelTypeMunger) o;
        if (element.getMunger() instanceof NewMethodTypeMunger) {
View Full Code Here


      if (shouldCheck) {
        // Quickly check if an ITD supplies the 'missing' member
        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();
            itdMatch = declA.matches(nctm.getSignature(), world);
          }
        }
        if (!itdMatch) {
          IMessage message = null;
View Full Code Here

                // 2. Check ITDCs to see if the necessary ctor is provided that way
                boolean satisfiedByITDC = false;
                for (Iterator<ConcreteTypeMunger> ii = newParentTarget.getType()
                    .getInterTypeMungersIncludingSupers().iterator(); ii.hasNext() && !satisfiedByITDC;) {
                  ConcreteTypeMunger m = ii.next();
                  if (m.getMunger() instanceof NewConstructorTypeMunger) {
                    if (m.getSignature().getSignature().equals(invokeSpecial.getSignature(cpg))) {
                      satisfiedByITDC = true;
                    }
                  }
                }
View Full Code Here

      }
    }
    // try itds before we give up (this doesnt find annotations - the signature returned may not include them)
    List<ConcreteTypeMunger> mungers = type.getInterTypeMungersIncludingSupers();
    for (Iterator<ConcreteTypeMunger> iter = mungers.iterator(); iter.hasNext();) {
      ConcreteTypeMunger munger = iter.next();
      Member member = munger.getSignature();
      if (signaturePattern.matches(member, type.getWorld(), false)) {
        if (!Modifier.isPublic(member.getModifiers())) {
          continue;
        }
        return true;
View Full Code Here

      if (rMember.isAnnotatedElsewhere()) {
        if (kind == Shadow.FieldGet || kind == Shadow.FieldSet) {
          // FIXME asc should include supers with getInterTypeMungersIncludingSupers ?
          List mungers = rMember.getDeclaringType().resolve(shadow.getIWorld()).getInterTypeMungers();
          for (Iterator iter = mungers.iterator(); iter.hasNext();) {
            ConcreteTypeMunger typeMunger = (ConcreteTypeMunger) iter.next();
            if (typeMunger.getMunger() instanceof NewFieldTypeMunger) {
              ResolvedMember fakerm = typeMunger.getSignature();
              if (fakerm.equals(member)) {
                ResolvedMember ajcMethod = AjcMemberMaker.interFieldInitializer(fakerm, typeMunger.getAspectType());
                ResolvedMember rmm = findMethod(typeMunger.getAspectType(), ajcMethod);
                toMatchAgainst = rmm;
              }
            }
          }
        }
View Full Code Here

    if (foundMember == null) {
      // check the ITD'd dooberries
      List<ConcreteTypeMunger> mungers = relevantType.resolve(world).getInterTypeMungers();
      for (Iterator<ConcreteTypeMunger> iter = mungers.iterator(); iter.hasNext();) {
        Object munger = iter.next();
        ConcreteTypeMunger typeMunger = (ConcreteTypeMunger) munger;
        if (typeMunger.getMunger() instanceof NewMethodTypeMunger
            || typeMunger.getMunger() instanceof NewConstructorTypeMunger) {
          ResolvedMember fakerm = typeMunger.getSignature();
          // if (fakerm.hasAnnotations())

          ResolvedMember ajcMethod = (getSignature().getKind() == ResolvedMember.CONSTRUCTOR ? AjcMemberMaker
              .postIntroducedConstructor(typeMunger.getAspectType(), fakerm.getDeclaringType(),
                  fakerm.getParameterTypes()) : AjcMemberMaker.interMethodDispatcher(fakerm,
              typeMunger.getAspectType()));
          // AjcMemberMaker.interMethodBody(fakerm,typeMunger.getAspectType()));
          ResolvedMember rmm = findMethod(typeMunger.getAspectType(), ajcMethod);
          if (fakerm.getName().equals(getSignature().getName())
              && fakerm.getParameterSignature().equals(getSignature().getParameterSignature())) {
            relevantType = typeMunger.getAspectType();
            foundMember = rmm;
            return foundMember.getAnnotationTypes();
          }
        }
      }
View Full Code Here

      }
    }
    // try itds before we give up
    List<ConcreteTypeMunger> mungers = type.getInterTypeMungersIncludingSupers();
    for (Iterator<ConcreteTypeMunger> iter = mungers.iterator(); iter.hasNext();) {
      ConcreteTypeMunger munger = iter.next();
      Member member = munger.getSignature();
      if (signaturePattern.matches(member, type.getWorld(), false)) {
        if (!Modifier.isPublic(member.getModifiers())) {
          continue;
        }
        return true;
View Full Code Here

          if (discoveredImpl == null) {
            // didnt find a valid implementation, lets check the
            // ITDs on this type to see if they satisfy it
            boolean satisfiedByITD = false;
            for (Iterator ii = newParentTarget.getType().getInterTypeMungersIncludingSupers().iterator(); ii.hasNext();) {
              ConcreteTypeMunger m = (ConcreteTypeMunger) ii.next();
              if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.Method) {
                ResolvedMember sig = m.getSignature();
                if (!Modifier.isAbstract(sig.getModifiers())) {

                  // If the ITD shares a type variable with
                  // some target type, we need to tailor it
                  // for that
                  // type
                  if (m.isTargetTypeParameterized()) {
                    ResolvedType genericOnType = getWorld().resolve(sig.getDeclaringType()).getGenericType();
                    m = m.parameterizedFor(newParent.discoverActualOccurrenceOfTypeInHierarchy(genericOnType));
                    sig = m.getSignature(); // possible sig
                    // change when
                    // type
                    // parameters
                    // filled in
                  }
                  if (ResolvedType.matches(AjcMemberMaker.interMethod(sig, m.getAspectType(), sig
                      .getDeclaringType().resolve(weaver.getWorld()).isInterface()), o)) {
                    satisfiedByITD = true;
                  }
                }
              } else if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate2) {
                satisfiedByITD = true;// AV - that should be
                // enough, no need to
                // check more
              }
            }
View Full Code Here

                // 2. Check ITDCs to see if the necessary ctor is provided that way
                boolean satisfiedByITDC = false;
                for (Iterator ii = newParentTarget.getType().getInterTypeMungersIncludingSupers().iterator(); ii
                    .hasNext()
                    && !satisfiedByITDC;) {
                  ConcreteTypeMunger m = (ConcreteTypeMunger) ii.next();
                  if (m.getMunger() instanceof NewConstructorTypeMunger) {
                    if (m.getSignature().getSignature().equals(invokeSpecial.getSignature(cpg))) {
                      satisfiedByITDC = true;
                    }
                  }
                }
View Full Code Here

      if (shouldCheck) {
        // Quickly check if an ITD supplies the 'missing' member
        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();
            itdMatch = declA.matches(nctm.getSignature(), world);
          }
        }
        if (!itdMatch) {
          IMessage message = null;
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.ConcreteTypeMunger

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.