Package org.aspectj.weaver.patterns.Pointcut

Examples of org.aspectj.weaver.patterns.Pointcut.MatchesNothingPointcut


    if (isAnd(pc)) {
      AndPointcut apc = (AndPointcut) pc;
      Pointcut right = removeNothings(apc.getRight());
      Pointcut left = removeNothings(apc.getLeft());
      if (left instanceof MatchesNothingPointcut || right instanceof MatchesNothingPointcut) {
        return new MatchesNothingPointcut();
      }
      return new AndPointcut(left, right);
    } else if (isOr(pc)) {
      OrPointcut opc = (OrPointcut) pc;
      Pointcut right = removeNothings(opc.getRight());
      Pointcut left = removeNothings(opc.getLeft());
      if (left instanceof MatchesNothingPointcut && !(right instanceof MatchesNothingPointcut)) {
        return right;
      } else if (right instanceof MatchesNothingPointcut && !(left instanceof MatchesNothingPointcut)) {
        return left;
      } else if (!(left instanceof MatchesNothingPointcut) && !(right instanceof MatchesNothingPointcut)) {
        return new OrPointcut(left, right);
      } else if (left instanceof MatchesNothingPointcut && right instanceof MatchesNothingPointcut) {
        return new MatchesNothingPointcut();
      }
    }
    return pc;
  }
View Full Code Here


  private Pointcut removeNothings(Pointcut pc) {
    if (isAnd(pc)) {
      AndPointcut apc = (AndPointcut)pc;
      Pointcut right = removeNothings(apc.getRight());
      Pointcut left  = removeNothings(apc.getLeft());
      if (left instanceof MatchesNothingPointcut || right instanceof MatchesNothingPointcut) return new MatchesNothingPointcut();
      return new AndPointcut(left,right);
    } else if (isOr(pc)) {
      OrPointcut opc = (OrPointcut)pc;
      Pointcut right = removeNothings(opc.getRight());
      Pointcut left  = removeNothings(opc.getLeft());
      if (left instanceof MatchesNothingPointcut
          && !(right instanceof MatchesNothingPointcut)) {
        return right;
      } else if (right instanceof MatchesNothingPointcut
          && !(left instanceof MatchesNothingPointcut)) {
        return left;
      } else if (!(left instanceof MatchesNothingPointcut)
          && !(right instanceof MatchesNothingPointcut)) {
        return new OrPointcut(left,right);
      } else if (left instanceof MatchesNothingPointcut
          && right instanceof MatchesNothingPointcut) {
        return new MatchesNothingPointcut()
      }     
    }
    return pc;
  }
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.patterns.Pointcut.MatchesNothingPointcut

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.