Package org.aspectj.weaver

Examples of org.aspectj.weaver.ConcreteTypeMunger


    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


                // 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

    }
    // 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

   */
  private void processTypeMungersFromExistingWeaverState(SourceTypeBinding sourceType, ResolvedType onType) {
    Collection previouslyAppliedMungers = onType.getWeaverState().getTypeMungers(onType);

    for (Iterator i = previouslyAppliedMungers.iterator(); i.hasNext();) {
      ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
      EclipseTypeMunger munger = factory.makeEclipseTypeMunger(m);
      if (munger.munge(sourceType, onType)) {
        if (onType.isInterface() && munger.getMunger().needsAccessToTopmostImplementor()) {
          if (!onType.getWorld().getCrosscuttingMembersSet().containsAspect(munger.getAspectType())) {
            dangerousInterfaces
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

      // we sort it out elsewhere and don't come into this method -
      // so we don't have to worry about interfaces, just the superclass.
      onTypeX = factory.fromEclipse(type.superclass()); // abstractMethod.declaringClass);
    }
    for (Iterator i = onTypeX.getInterTypeMungersIncludingSupers().iterator(); i.hasNext();) {
      ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
      ResolvedMember sig = m.getSignature();
      if (!Modifier.isAbstract(sig.getModifiers())) {
        if (ResolvedType.matches(
            AjcMemberMaker.interMethod(sig, m.getAspectType(), sig.getDeclaringType().resolve(factory.getWorld())
                .isInterface()), factory.makeResolvedMember(concreteMethod))) {
          return;
        }
      }
    }
View Full Code Here

    // affects other code in the problem reporter that looks through ITDs...
    ResolvedType supertypeToLookAt = onTypeX.getSuperclass();
    while (supertypeToLookAt != null) {
      List itMungers = supertypeToLookAt.getInterTypeMungers();
      for (Iterator i = itMungers.iterator(); i.hasNext();) {
        ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
        ResolvedMember sig = m.getSignature();
        if (sig == null)
          continue; // we aren't interested in other kinds of munger
        UnresolvedType dType = sig.getDeclaringType();
        if (dType == null)
          continue;
        ResolvedType resolvedDeclaringType = dType.resolve(factory.getWorld());
        ResolvedMember rm = AjcMemberMaker.interMethod(sig, m.getAspectType(), resolvedDeclaringType.isInterface());
        if (ResolvedType.matches(rm, possiblyErroneousRm)) {
          // match, so dont need to report a problem!
          return;
        }
      }
View Full Code Here

      } else {
        weaverType = factory.fromEclipse(type.superclass());
      }
      Set checked = new HashSet();
      for (Iterator i = weaverType.getInterTypeMungersIncludingSupers().iterator(); i.hasNext();) {
        ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
        ResolvedType theAspect = m.getAspectType();
        if (!checked.contains(theAspect)) {
          TypeBinding tb = factory.makeTypeBinding(m.getAspectType());
          // Let's check the privilegedHandler from that aspect
          if (tb instanceof SourceTypeBinding) { // BinaryTypeBinding is also a SourceTypeBinding ;)
            IPrivilegedHandler privilegedHandler = ((SourceTypeBinding) tb).privilegedHandler;
            if (privilegedHandler != null) {
              if (privilegedHandler.definesPrivilegedAccessToField(fieldDecl.binding)) {
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

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.