Package org.aspectj.weaver.patterns

Examples of org.aspectj.weaver.patterns.DeclarePrecedence


      PrecedenceCacheKey key = new PrecedenceCacheKey(firstAspect, secondAspect);
      if (cachedResults.containsKey(key)) {
        return (cachedResults.get(key)).intValue();
      } else {
        int order = 0;
        DeclarePrecedence orderer = null; // Records the declare
        // precedence statement that
        // gives the first ordering
        for (Iterator<Declare> i = world.getCrosscuttingMembersSet().getDeclareDominates().iterator(); i.hasNext();) {
          DeclarePrecedence d = (DeclarePrecedence) i.next();
          int thisOrder = d.compare(firstAspect, secondAspect);
          if (thisOrder != 0) {
            if (orderer == null) {
              orderer = d;
            }
            if (order != 0 && order != thisOrder) {
              ISourceLocation[] isls = new ISourceLocation[2];
              isls[0] = orderer.getSourceLocation();
              isls[1] = d.getSourceLocation();
              Message m = new Message("conflicting declare precedence orderings for aspects: "
                  + firstAspect.getName() + " and " + secondAspect.getName(), null, true, isls);
              world.getMessageHandler().handleMessage(m);
            } else {
              order = thisOrder;
View Full Code Here


        node.setName(name + AsmRelationshipUtils.DECLARE_SOFT);
        node.setDetails(genTypePatternLabel(ds.getException()));

      } else if (declare.declareDecl instanceof DeclarePrecedence) {
        node.setKind(IProgramElement.Kind.DECLARE_PRECEDENCE);
        DeclarePrecedence ds = (DeclarePrecedence) declare.declareDecl;
        node.setName(name + AsmRelationshipUtils.DECLARE_PRECEDENCE);
        node.setDetails(genPrecedenceListLabel(ds.getPatterns()));

      } else if (declare.declareDecl instanceof DeclareAnnotation) {
        DeclareAnnotation deca = (DeclareAnnotation) declare.declareDecl;
        String thekind = deca.getKind().toString();
        node.setName(name + "@" + thekind.substring(3));
View Full Code Here

      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

    if (aspect != null) {
      NameValuePair precedence = getAnnotationElement(aspect, VALUE);
      if (precedence != null) {
        String precedencePattern = precedence.getValue().stringifyValue();
        PatternParser parser = new PatternParser(precedencePattern);
        DeclarePrecedence ajPrecedence = parser.parseDominates();
        struct.ajAttributes.add(new AjAttribute.DeclareAttribute(ajPrecedence));
        return true;
      }
    }
    return false;
View Full Code Here

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

    if (aspect != null) {
      NameValuePair precedence = getAnnotationElement(aspect, VALUE);
      if (precedence != null) {
        String precedencePattern = precedence.getValue().stringifyValue();
        PatternParser parser = new PatternParser(precedencePattern);
        DeclarePrecedence ajPrecedence = parser.parseDominates();
        struct.ajAttributes.add(new AjAttribute.DeclareAttribute(ajPrecedence));
        return true;
      }
    }
    return false;
View Full Code Here

      PrecedenceCacheKey key = new PrecedenceCacheKey(firstAspect, secondAspect);
      if (cachedResults.containsKey(key)) {
        return (cachedResults.get(key)).intValue();
      } else {
        int order = 0;
        DeclarePrecedence orderer = null; // Records the declare
        // precedence statement that
        // gives the first ordering
        for (Iterator<Declare> i = world.getCrosscuttingMembersSet().getDeclareDominates().iterator(); i.hasNext();) {
          DeclarePrecedence d = (DeclarePrecedence) i.next();
          int thisOrder = d.compare(firstAspect, secondAspect);
          if (thisOrder != 0) {
            if (orderer == null) {
              orderer = d;
            }
            if (order != 0 && order != thisOrder) {
              ISourceLocation[] isls = new ISourceLocation[2];
              isls[0] = orderer.getSourceLocation();
              isls[1] = d.getSourceLocation();
              Message m = new Message("conflicting declare precedence orderings for aspects: "
                  + firstAspect.getName() + " and " + secondAspect.getName(), null, true, isls);
              world.getMessageHandler().handleMessage(m);
            } else {
              order = thisOrder;
View Full Code Here

      PrecedenceCacheKey key = new PrecedenceCacheKey(firstAspect, secondAspect);
      if (cachedResults.containsKey(key)) {
        return ((Integer) cachedResults.get(key)).intValue();
      } else {
        int order = 0;
        DeclarePrecedence orderer = null; // Records the declare
        // precedence statement that
        // gives the first ordering
        for (Iterator i = world.getCrosscuttingMembersSet().getDeclareDominates().iterator(); i.hasNext();) {
          DeclarePrecedence d = (DeclarePrecedence) i.next();
          int thisOrder = d.compare(firstAspect, secondAspect);
          if (thisOrder != 0) {
            if (orderer == null) {
              orderer = d;
            }
            if (order != 0 && order != thisOrder) {
              ISourceLocation[] isls = new ISourceLocation[2];
              isls[0] = orderer.getSourceLocation();
              isls[1] = d.getSourceLocation();
              Message m = new Message("conflicting declare precedence orderings for aspects: "
                  + firstAspect.getName() + " and " + secondAspect.getName(), null, true, isls);
              world.getMessageHandler().handleMessage(m);
            } else {
              order = thisOrder;
View Full Code Here

    if (aspect != null) {
      NameValuePair precedence = getAnnotationElement(aspect, VALUE);
      if (precedence != null) {
        String precedencePattern = precedence.getValue().stringifyValue();
        PatternParser parser = new PatternParser(precedencePattern);
        DeclarePrecedence ajPrecedence = parser.parseDominates();
        struct.ajAttributes.add(new AjAttribute.DeclareAttribute(ajPrecedence));
        return true;
      }
    }
    return false;
View Full Code Here

      PrecedenceCacheKey key = new PrecedenceCacheKey(firstAspect,secondAspect);
      if (cachedResults.containsKey(key)) {
        return ((Integer) cachedResults.get(key)).intValue();
      } else {
        int order = 0;
        DeclarePrecedence orderer = null; // Records the declare precedence statement that gives the first ordering
        for (Iterator i = world.getCrosscuttingMembersSet().getDeclareDominates().iterator(); i.hasNext(); ) {
          DeclarePrecedence d = (DeclarePrecedence)i.next();
          int thisOrder = d.compare(firstAspect, secondAspect);
          if (thisOrder != 0) {
            if (orderer==null) orderer = d;
            if (order != 0 && order != thisOrder) {
              ISourceLocation[] isls = new ISourceLocation[2];
              isls[0]=orderer.getSourceLocation();
              isls[1]=d.getSourceLocation();
              Message m =
                new Message("conflicting declare precedence orderings for aspects: "+
                            firstAspect.getName()+" and "+secondAspect.getName(),null,true,isls);
              world.getMessageHandler().handleMessage(m);
            } else {
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.patterns.DeclarePrecedence

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.