public AnnotationPatternList parseArgumentsAnnotationPattern() { List<AnnotationTypePattern> patterns = new ArrayList<AnnotationTypePattern>(); eat("("); if (maybeEat(")")) { return new AnnotationPatternList(); } do { if (maybeEat(".")) { eat("."); patterns.add(AnnotationTypePattern.ELLIPSIS); } else if (maybeEat("*")) { patterns.add(AnnotationTypePattern.ANY); } else { patterns.add(parseAnnotationNameOrVarTypePattern()); } } while (maybeEat(",")); eat(")"); return new AnnotationPatternList(patterns); }
private Pointcut parseThisOrTargetAnnotationPointcut() { String kind = parseIdentifier(); eat("("); if (maybeEat(")")) { throw new ParserException("expecting @AnnotationName or parameter, but found ')'", tokenSource.peek()); } ExactAnnotationTypePattern type = parseAnnotationNameOrVarTypePattern(); eat(")"); return new ThisOrTargetAnnotationPointcut(kind.equals("this"), type); }
private Pointcut parseAtAnnotationPointcut() { parseIdentifier(); eat("("); if (maybeEat(")")) { throw new ParserException("@AnnotationName or parameter", tokenSource.peek()); } ExactAnnotationTypePattern type = parseAnnotationNameOrVarTypePattern(); eat(")"); return new AnnotationPointcut(type); }
private Pointcut parseWithinAnnotationPointcut() { /* String kind = */parseIdentifier(); eat("("); if (maybeEat(")")) { throw new ParserException("expecting @AnnotationName or parameter, but found ')'", tokenSource.peek()); } AnnotationTypePattern type = parseAnnotationNameOrVarTypePattern(); eat(")"); return new WithinAnnotationPointcut(type); }
private Pointcut parseWithinCodeAnnotationPointcut() { /* String kind = */parseIdentifier(); eat("("); if (maybeEat(")")) { throw new ParserException("expecting @AnnotationName or parameter, but found ')'", tokenSource.peek()); } ExactAnnotationTypePattern type = parseAnnotationNameOrVarTypePattern(); eat(")"); return new WithinCodeAnnotationPointcut(type); }