Examples of DeclareParents


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

      if (ad.concreteName != null) {
        List declares = ad.concreteName.declares;
        for (Iterator iter = declares.iterator(); iter.hasNext();) {
          Object dec = iter.next();
          if (dec instanceof DeclareParents) {
            DeclareParents decp = (DeclareParents) dec;
            TypePattern[] newparents = decp.getParents().getTypePatterns();
            for (int i = 0; i < newparents.length; i++) {
              TypePattern pattern = newparents[i];
              UnresolvedType ut = pattern.getExactType();
              if (ut == null)
                continue;
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

          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 (DeclareAnnotation decA : getCrosscuttingMembersSet().getDeclareAnnotationOnTypes()) {
      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

    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

  public ResolvedType findAspectDeclaringParents(DeclareParents p) {
    Set<ResolvedType> keys = this.members.keySet();
    for (Iterator<ResolvedType> iter = keys.iterator(); iter.hasNext();) {
      ResolvedType element = iter.next();
      for (Iterator i = members.get(element).getDeclareParents().iterator(); i.hasNext();) {
        DeclareParents dp = (DeclareParents) i.next();
        if (dp.equals(p)) {
          return element;
        }
      }
    }
    return null;
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
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.