Examples of DeclareParents


Examples of org.aspectj.weaver.patterns.DeclareParents

      // the up front comparison
      if (!careAboutShadowMungers) {
        // this means we are in front end compilation and if the differences are purely mixin parents, we can continue OK
        Set<DeclareParents> trimmedThis = new HashSet<DeclareParents>();
        for (Iterator<DeclareParents> iterator = declareParents.iterator(); iterator.hasNext();) {
          DeclareParents decp = iterator.next();
          if (!decp.isMixin()) {
            trimmedThis.add(decp);
          }
        }
        Set<DeclareParents> trimmedOther = new HashSet<DeclareParents>();
        for (Iterator<DeclareParents> iterator = other.declareParents.iterator(); iterator.hasNext();) {
          DeclareParents decp = iterator.next();
          if (!decp.isMixin()) {
            trimmedOther.add(decp);
          }
        }
        if (!trimmedThis.equals(trimmedOther)) {
          changed = true;
View Full Code Here

Examples of org.aspectj.weaver.patterns.DeclareParents

      m.setDeclaringType(declare.getDeclaringType());
      addShadowMunger(m);
    } else if (declare instanceof DeclarePrecedence) {
      declareDominates.add(declare);
    } else if (declare instanceof DeclareParents) {
      DeclareParents dp = (DeclareParents) declare;
      exposeTypes(dp.getParents().getExactTypes());
      declareParents.add(dp);
    } else if (declare instanceof DeclareSoft) {
      DeclareSoft d = (DeclareSoft) declare;
      // Ordered so that during concretization we can check the related
      // munger
View Full Code Here

Examples of org.aspectj.weaver.patterns.DeclareParents

      // the up front comparison
      if (!careAboutShadowMungers) {
        // this means we are in front end compilation and if the differences are purely mixin parents, we can continue OK
        Set<DeclareParents> trimmedThis = new HashSet<DeclareParents>();
        for (Iterator<DeclareParents> iterator = declareParents.iterator(); iterator.hasNext();) {
          DeclareParents decp = iterator.next();
          if (!decp.isMixin()) {
            trimmedThis.add(decp);
          }
        }
        Set<DeclareParents> trimmedOther = new HashSet<DeclareParents>();
        for (Iterator<DeclareParents> iterator = other.declareParents.iterator(); iterator.hasNext();) {
          DeclareParents decp = iterator.next();
          if (!decp.isMixin()) {
            trimmedOther.add(decp);
          }
        }
        if (!trimmedThis.equals(trimmedOther)) {
          changed = true;
View Full Code Here

Examples of org.aspectj.weaver.patterns.DeclareParents

    boolean aParentChangeOccurred = false;
    boolean anAnnotationChangeOccurred = false;
    // First pass - apply all decp mungers
    for (Iterator i = declareParentsList.iterator(); i.hasNext();) {
      DeclareParents decp = (DeclareParents) i.next();
      boolean typeChanged = applyDeclareParents(decp, onType);
      if (typeChanged) {
        aParentChangeOccurred = true;
      } else {
        decpToRepeat.add(decp);
      }
    }

    // Still first pass - apply all dec @type mungers
    for (Iterator i = xcutSet.getDeclareAnnotationOnTypes().iterator(); i.hasNext();) {
      DeclareAnnotation decA = (DeclareAnnotation) i.next();
      boolean typeChanged = applyDeclareAtType(decA, onType, true);
      if (typeChanged) {
        anAnnotationChangeOccurred = true;
      }
    }

    while ((aParentChangeOccurred || anAnnotationChangeOccurred) && !decpToRepeat.isEmpty()) {
      anAnnotationChangeOccurred = aParentChangeOccurred = false;
      List<DeclareParents> decpToRepeatNextTime = new ArrayList<DeclareParents>();
      for (Iterator<DeclareParents> iter = decpToRepeat.iterator(); iter.hasNext();) {
        DeclareParents decp = iter.next();
        boolean typeChanged = applyDeclareParents(decp, onType);
        if (typeChanged) {
          aParentChangeOccurred = true;
        } else {
          decpToRepeatNextTime.add(decp);
View Full Code Here

Examples of org.aspectj.weaver.patterns.DeclareParents

          FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0];
          IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings);
          // first add the declare implements like
          List<TypePattern> parents = new ArrayList<TypePattern>(1);
          parents.add(parent);
          DeclareParents dp = new DeclareParents(typePattern, parents, false);
          dp.resolve(binding); // resolves the parent and child parts
          // of the decp

          // resolve this so that we can use it for the
          // MethodDelegateMungers below.
          // eg. '@Coloured *' will change from a WildTypePattern to
          // an 'AnyWithAnnotationTypePattern' after this
          // resolution
          typePattern = typePattern.resolveBindings(binding, Bindings.NONE, false, false);
          // TODO kick ISourceLocation sl =
          // struct.bField.getSourceLocation(); ??
          // dp.setLocation(dp.getDeclaringType().getSourceContext(),
          // dp.getDeclaringType().getSourceLocation().getOffset(),
          // dp.getDeclaringType().getSourceLocation().getOffset());
          dp.setLocation(struct.context, -1, -1); // not ideal...
          struct.ajAttributes.add(new AjAttribute.DeclareAttribute(dp));

          // do we have a defaultImpl=xxx.class (ie implementation)
          String defaultImplClassName = null;
          NameValuePair defaultImplNVP = getAnnotationElement(decp, "defaultImpl");
View Full Code Here

Examples of org.aspectj.weaver.patterns.DeclareParents

    // Create the declare parents that will add the interfaces to matching targets
    FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0];
    IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings);
    // how do we mark this as a decp due to decmixin?
    DeclareParents dp = new DeclareParentsMixin(targetTypePattern, newParents);
    dp.resolve(binding);
    targetTypePattern = dp.getChild();

    dp.setLocation(struct.context, -1, -1); // not ideal...
    struct.ajAttributes.add(new AjAttribute.DeclareAttribute(dp));

    // The factory method for building the implementation is the
    // one attached to the annotation:
    // Method implementationFactory = struct.method;
View Full Code Here

Examples of org.aspectj.weaver.patterns.DeclareParents

    boolean aParentChangeOccurred = false;
    boolean anAnnotationChangeOccurred = false;
    // First pass - apply all decp mungers
    for (Iterator<DeclareParents> i = declareParentsList.iterator(); i.hasNext();) {
      DeclareParents decp = i.next();
      boolean typeChanged = applyDeclareParents(decp, onType);
      if (typeChanged) {
        aParentChangeOccurred = true;
      } else { // Perhaps it would have matched if a 'dec @type' had
        // modified the type
        if (!decp.getChild().isStarAnnotation()) {
          decpToRepeat.add(decp);
        }
      }
    }

    // Still first pass - apply all dec @type mungers
    for (Iterator i = getCrosscuttingMembersSet().getDeclareAnnotationOnTypes().iterator(); i.hasNext();) {
      DeclareAnnotation decA = (DeclareAnnotation) i.next();
      boolean typeChanged = applyDeclareAtType(decA, onType, true);
      if (typeChanged) {
        anAnnotationChangeOccurred = true;
      }
    }

    while ((aParentChangeOccurred || anAnnotationChangeOccurred) && !decpToRepeat.isEmpty()) {
      anAnnotationChangeOccurred = aParentChangeOccurred = false;
      List<DeclareParents> decpToRepeatNextTime = new ArrayList<DeclareParents>();
      for (Iterator<DeclareParents> iter = decpToRepeat.iterator(); iter.hasNext();) {
        DeclareParents decp = iter.next();
        boolean typeChanged = applyDeclareParents(decp, onType);
        if (typeChanged) {
          aParentChangeOccurred = true;
        } else {
          decpToRepeatNextTime.add(decp);
View Full Code Here

Examples of org.aspectj.weaver.patterns.DeclareParents

    boolean aParentChangeOccurred      = false;
    boolean anAnnotationChangeOccurred = false;
    // First pass - apply all decp mungers
    for (Iterator i = declareParentsList.iterator(); i.hasNext(); ) {
      DeclareParents decp = (DeclareParents)i.next();
      boolean typeChanged = applyDeclareParents(decp,onType);
      if (typeChanged) {
        aParentChangeOccurred = true;
      } else { // Perhaps it would have matched if a 'dec @type' had modified the type
        if (!decp.getChild().isStarAnnotation()) decpToRepeat.add(decp);
      }
    }

    // Still first pass - apply all dec @type mungers
    for (Iterator i = xcutSet.getDeclareAnnotationOnTypes().iterator();i.hasNext();) {
      DeclareAnnotation decA = (DeclareAnnotation)i.next();
      boolean typeChanged = applyDeclareAtType(decA,onType,true);
      if (typeChanged) {
        anAnnotationChangeOccurred = true;
      }
    }
   
    while ((aParentChangeOccurred || anAnnotationChangeOccurred) && !decpToRepeat.isEmpty()) {
      anAnnotationChangeOccurred = aParentChangeOccurred = false;
      List decpToRepeatNextTime = new ArrayList();
      for (Iterator iter = decpToRepeat.iterator(); iter.hasNext();) {
        DeclareParents decp = (DeclareParents) iter.next();
        boolean typeChanged = applyDeclareParents(decp,onType);
        if (typeChanged) {
          aParentChangeOccurred = true;
        } else {
          decpToRepeatNextTime.add(decp);
View Full Code Here

Examples of org.aspectj.weaver.patterns.DeclareParents

    } else if (declareDecl instanceof DeclareErrorOrWarning) {
      DeclareErrorOrWarning dd = (DeclareErrorOrWarning) declareDecl;
      annotation = AtAspectJAnnotationFactory
                  .createDeclareErrorOrWarningAnnotation(dd.getPointcut().toString(),dd.getMessage(),dd.isError(),declarationSourceStart);
    } else if (declareDecl instanceof DeclareParents) {
      DeclareParents dp = (DeclareParents) declareDecl;
      String childPattern = dp.getChild().toString();
      Collection parentPatterns = dp.getParents().getExactTypes();
      StringBuffer parents = new StringBuffer();
      for (Iterator iter = parentPatterns.iterator(); iter.hasNext();) {
        UnresolvedType  urt = ((UnresolvedType) iter.next());
        parents.append(urt.getName());
        if (iter.hasNext()) parents.append(", ");
      }   
      annotation = AtAspectJAnnotationFactory
                  .createDeclareParentsAnnotation(childPattern,parents.toString(),dp.isExtends(),declarationSourceStart);
    } else if (declareDecl instanceof DeclarePrecedence) {
      DeclarePrecedence dp = (DeclarePrecedence) declareDecl;
      String precedenceList = dp.getPatterns().toString();
      annotation = AtAspectJAnnotationFactory.createDeclarePrecedenceAnnotation(precedenceList,declarationSourceStart);
    } else if (declareDecl instanceof DeclareSoft) {
      DeclareSoft ds = (DeclareSoft) declareDecl;
      annotation = AtAspectJAnnotationFactory
        .createDeclareSoftAnnotation(ds.getPointcut().toString(),ds.getException().getExactType().getName(),declarationSourceStart);     
View Full Code Here

Examples of org.aspectj.weaver.patterns.DeclareParents

      m.setDeclaringType(declare.getDeclaringType());
      addShadowMunger(m);
    } else if (declare instanceof DeclarePrecedence) {
      declareDominates.add(declare);
    } else if (declare instanceof DeclareParents) {
      DeclareParents dp = (DeclareParents)declare;
      exposeTypes(dp.getParents().getExactTypes());
      declareParents.add(dp);
    } else if (declare instanceof DeclareSoft) {
      DeclareSoft d = (DeclareSoft)declare;
      // Ordered so that during concretization we can check the related munger
      ShadowMunger m = Advice.makeSoftener(world, d.getPointcut(), d.getException(),inAspect,d);
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.