Examples of DeclareParents


Examples of org.aspectj.lang.annotation.DeclareParents

   * <p>Resulting Advisors will need to be evaluated for targets.
   * @param introductionField the field to introspect
   * @return <code>null</code> if not an Advisor
   */
  private Advisor getDeclareParentsAdvisor(Field introductionField) {
    DeclareParents declareParents = (DeclareParents) introductionField.getAnnotation(DeclareParents.class);
    if (declareParents == null) {
      // Not an introduction field
      return null;
    }

    if (DeclareParents.class.equals(declareParents.defaultImpl())) {
      // This is what comes back if it wasn't set. This seems bizarre...
      // TODO this restriction possibly should be relaxed
      throw new IllegalStateException("defaultImpl must be set on DeclareParents");
    }

    return new DeclareParentsAdvisor(
        introductionField.getType(), declareParents.value(), declareParents.defaultImpl());
  }
View Full Code Here

Examples of org.aspectj.lang.annotation.DeclareParents

   * <p>Resulting Advisors will need to be evaluated for targets.
   * @param introductionField the field to introspect
   * @return <code>null</code> if not an Advisor
   */
  private Advisor getDeclareParentsAdvisor(Field introductionField) {
    DeclareParents declareParents = introductionField.getAnnotation(DeclareParents.class);
    if (declareParents == null) {
      // Not an introduction field
      return null;
    }

    if (DeclareParents.class.equals(declareParents.defaultImpl())) {
      // This is what comes back if it wasn't set. This seems bizarre...
      // TODO this restriction possibly should be relaxed
      throw new IllegalStateException("defaultImpl must be set on DeclareParents");
    }

    return new DeclareParentsAdvisor(
        introductionField.getType(), declareParents.value(), declareParents.defaultImpl());
  }
View Full Code Here

Examples of org.aspectj.lang.annotation.DeclareParents

   * <p>Resulting Advisors will need to be evaluated for targets.
   * @param introductionField the field to introspect
   * @return <code>null</code> if not an Advisor
   */
  private Advisor getDeclareParentsAdvisor(Field introductionField) {
    DeclareParents declareParents = (DeclareParents) introductionField.getAnnotation(DeclareParents.class);
    if (declareParents == null) {
      // Not an introduction field
      return null;
    }

    if (DeclareParents.class.equals(declareParents.defaultImpl())) {
      // This is what comes back if it wasn't set. This seems bizarre...
      // TODO this restriction possibly should be relaxed
      throw new IllegalStateException("defaultImpl must be set on DeclareParents");
    }

    return new DeclareParentsAdvisor(
        introductionField.getType(), declareParents.value(), declareParents.defaultImpl());
  }
View Full Code Here

Examples of org.aspectj.lang.annotation.DeclareParents

   * <p>Resulting Advisors will need to be evaluated for targets.
   * @param introductionField the field to introspect
   * @return {@code null} if not an Advisor
   */
  private Advisor getDeclareParentsAdvisor(Field introductionField) {
    DeclareParents declareParents = introductionField.getAnnotation(DeclareParents.class);
    if (declareParents == null) {
      // Not an introduction field
      return null;
    }

    if (DeclareParents.class.equals(declareParents.defaultImpl())) {
      // This is what comes back if it wasn't set. This seems bizarre...
      // TODO this restriction possibly should be relaxed
      throw new IllegalStateException("defaultImpl must be set on DeclareParents");
    }

    return new DeclareParentsAdvisor(
        introductionField.getType(), declareParents.value(), declareParents.defaultImpl());
  }
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

        node.setDetails("\"" + AsmRelationshipUtils.genDeclareMessage(deow.getMessage()) + "\"");

      } else if (declare.declareDecl instanceof DeclareParents) {

        node.setKind(IProgramElement.Kind.DECLARE_PARENTS);
        DeclareParents dp = (DeclareParents) declare.declareDecl;
        node.setName(name + AsmRelationshipUtils.DECLARE_PARENTS);

        String kindOfDP = null;
        StringBuffer details = new StringBuffer("");
        TypePattern[] newParents = dp.getParents().getTypePatterns();
        for (int i = 0; i < newParents.length; i++) {
          TypePattern tp = newParents[i];
          UnresolvedType tx = tp.getExactType();
          if (kindOfDP == null) {
            kindOfDP = "implements ";
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

        StringLiteral message = new StringLiteral(this.ast);
        message.setEscapedValue(updateString(deow.getMessage()));
        ((DeclareWarningDeclaration) declareDeclaration).setMessage(message);
      }
    } else if (declare instanceof DeclareParents) {
      DeclareParents dp = (DeclareParents) declare;
      declareDeclaration = new org.aspectj.org.eclipse.jdt.core.dom.DeclareParentsDeclaration(this.ast, dp.isExtends());
      org.aspectj.org.eclipse.jdt.core.dom.PatternNode pNode = convert(dp.getChild());
      if (pNode instanceof org.aspectj.org.eclipse.jdt.core.dom.TypePattern) {
        ((DeclareParentsDeclaration) declareDeclaration)
            .setChildTypePattern((org.aspectj.org.eclipse.jdt.core.dom.TypePattern) pNode);
      }
      TypePattern[] weaverTypePatterns = dp.getParents().getTypePatterns();
      List typePatterns = ((DeclareParentsDeclaration) declareDeclaration).parentTypePatterns();
      for (int i = 0; i < weaverTypePatterns.length; i++) {
        typePatterns.add(convert(weaverTypePatterns[i]));
      }
    } else if (declare instanceof DeclarePrecedence) {
      declareDeclaration = new org.aspectj.org.eclipse.jdt.core.dom.DeclarePrecedenceDeclaration(this.ast);
      DeclarePrecedence dp = (DeclarePrecedence) declare;
      TypePattern[] weaverTypePatterns = dp.getPatterns().getTypePatterns();
      List typePatterns = ((DeclarePrecedenceDeclaration) declareDeclaration).typePatterns();
      for (int i = 0; i < weaverTypePatterns.length; i++) {
        typePatterns.add(convert(weaverTypePatterns[i]));
      }
    } else if (declare instanceof DeclareSoft) {
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
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.