public AspectJTypeFilter(String typePatternExpression, @Nullable ClassLoader classLoader) { this.world = new BcelWorld(classLoader, IMessageHandler.THROW, null); this.world.setBehaveInJava5Way(true); PatternParser patternParser = new PatternParser(typePatternExpression); TypePattern typePattern = patternParser.parseTypePattern(); typePattern.resolve(this.world); IScope scope = new SimpleScope(this.world, new FormalBinding[0]); this.typePattern = typePattern.resolveBindings(scope, Bindings.NONE, false, false); }
public AspectJTypeFilter(String typePatternExpression, @Nullable ClassLoader classLoader) { this.world = new BcelWorld(classLoader, IMessageHandler.THROW, null); this.world.setBehaveInJava5Way(true); PatternParser patternParser = new PatternParser(typePatternExpression); TypePattern typePattern = patternParser.parseTypePattern(); typePattern.resolve(this.world); IScope scope = new SimpleScope(this.world, new FormalBinding[0]); this.typePattern = typePattern.resolveBindings(scope, Bindings.NONE, false, false); }
public AspectJTypeFilter(String typePatternExpression, ClassLoader classLoader) { this.world = new BcelWorld(classLoader, IMessageHandler.THROW, null); this.world.setBehaveInJava5Way(true); PatternParser patternParser = new PatternParser(typePatternExpression); TypePattern typePattern = patternParser.parseTypePattern(); typePattern.resolve(this.world); IScope scope = new SimpleScope(this.world, new FormalBinding[0]); this.typePattern = typePattern.resolveBindings(scope, Bindings.NONE, false, false); }
public TypePattern parseTypePattern() { return parseTypePattern(false, false); }
public DeclareAnnotation parseDeclareAtType() { allowHasTypePatterns = true; TypePattern p = parseTypePattern(); allowHasTypePatterns = false; return new DeclareAnnotation(DeclareAnnotation.AT_TYPE, p); }
private TypePattern[] maybeParseAdditionalInterfaceBounds() { List<TypePattern> boundsList = new ArrayList<TypePattern>(); while (maybeEat("&")) { TypePattern tp = parseTypePattern(); boundsList.add(tp); } if (boundsList.size() == 0) { return null; } TypePattern[] ret = new TypePattern[boundsList.size()]; boundsList.toArray(ret); return ret; }
public DeclarePrecedence parseDominates() { List<TypePattern> l = new ArrayList<TypePattern>(); do { l.add(parseTypePattern()); } while (maybeEat(",")); return new DeclarePrecedence(l); }
private void registerAspectExclude(final BcelWeaver weaver, final ClassLoader loader, final List<Definition> definitions) { String fastMatchInfo = null; for (Definition definition : definitions) { for (String exclude : definition.getAspectExcludePatterns()) { TypePattern excludePattern = new PatternParser(exclude).parseTypePattern(); aspectExcludeTypePattern.add(excludePattern); fastMatchInfo = looksLikeStartsWith(exclude); if (fastMatchInfo != null) { aspectExcludeStartsWith.add(fastMatchInfo); } } } }
private void registerAspectInclude(final BcelWeaver weaver, final ClassLoader loader, final List<Definition> definitions) { String fastMatchInfo = null; for (Definition definition : definitions) { for (String include : definition.getAspectIncludePatterns()) { TypePattern includePattern = new PatternParser(include).parseTypePattern(); aspectIncludeTypePattern.add(includePattern); fastMatchInfo = looksLikeStartsWith(include); if (fastMatchInfo != null) { aspectIncludeStartsWith.add(fastMatchInfo); } } } }
public TypePatternList maybeParseTypeParameterList() { if (!maybeEat("<")) { return null; } List<TypePattern> typePats = new ArrayList<TypePattern>(); do { TypePattern tp = parseTypePattern(true, false); typePats.add(tp); } while (maybeEat(",")); eat(">"); TypePattern[] tps = new TypePattern[typePats.size()]; typePats.toArray(tps); return new TypePatternList(tps); }
/** * Method parseThisOrTargetPointcut. * * @return Pointcut */ private Pointcut parseThisOrTargetPointcut(String kind) { eat("("); TypePattern type = parseTypePattern(); eat(")"); return new ThisOrTargetPointcut(kind.equals("this"), type); }
public TypeVariablePattern parseTypeVariable() { TypePattern upperBound = null; TypePattern[] additionalInterfaceBounds = null; TypePattern lowerBound = null; String typeVariableName = parseIdentifier(); if (maybeEatIdentifier("extends")) { upperBound = parseTypePattern(); additionalInterfaceBounds = maybeParseAdditionalInterfaceBounds(); } else if (maybeEatIdentifier("super")) { lowerBound = parseTypePattern(); } return new TypeVariablePattern(typeVariableName, upperBound, additionalInterfaceBounds, lowerBound); }
/** * Method parseWithinPointcut. * * @return Pointcut */ private Pointcut parseWithinPointcut() { // parseIdentifier(); eat("("); TypePattern type = parseTypePattern(); eat(")"); return new WithinPointcut(type); }
private TypePattern parseNotOrTypePattern(boolean insideTypeParameters, boolean parameterAnnotationsPossible) { TypePattern p = parseAtomicTypePattern(insideTypeParameters, parameterAnnotationsPossible); if (maybeEat("&&")) { p = new AndTypePattern(p, parseTypePattern(insideTypeParameters, parameterAnnotationsPossible)); } return p; }
private Declare parseSoft() { TypePattern p = parseTypePattern(); eat(":"); Pointcut pointcut = parsePointcut(); return new DeclareSoft(p, pointcut); }
private PerClause parsePerTypeWithin() { parseIdentifier(); eat("("); TypePattern withinTypePattern = parseTypePattern(); eat(")"); return new PerTypeWithin(withinTypePattern); }
public AspectJTypeFilter(String typePatternExpression, @Nullable ClassLoader classLoader) { this.world = new BcelWorld(classLoader, IMessageHandler.THROW, null); this.world.setBehaveInJava5Way(true); PatternParser patternParser = new PatternParser(typePatternExpression); TypePattern typePattern = patternParser.parseTypePattern(); typePattern.resolve(this.world); IScope scope = new SimpleScope(this.world, new FormalBinding[0]); this.typePattern = typePattern.resolveBindings(scope, Bindings.NONE, false, false); }
public AspectJTypeFilter(String typePatternExpression, @Nullable ClassLoader classLoader) { this.world = new BcelWorld(classLoader, IMessageHandler.THROW, null); this.world.setBehaveInJava5Way(true); PatternParser patternParser = new PatternParser(typePatternExpression); TypePattern typePattern = patternParser.parseTypePattern(); typePattern.resolve(this.world); IScope scope = new SimpleScope(this.world, new FormalBinding[0]); this.typePattern = typePattern.resolveBindings(scope, Bindings.NONE, false, false); }
public TypePattern parseTypePattern(boolean insideTypeParameters, boolean parameterAnnotationsPossible) { TypePattern p = parseAtomicTypePattern(insideTypeParameters, parameterAnnotationsPossible); if (maybeEat("&&")) { p = new AndTypePattern(p, parseNotOrTypePattern(insideTypeParameters, parameterAnnotationsPossible)); } if (maybeEat("||")) { p = new OrTypePattern(p, parseTypePattern(insideTypeParameters, parameterAnnotationsPossible)); } return p; }
public AspectJTypeFilter(String typePatternExpression, ClassLoader classLoader) { this.world = new BcelWorld(classLoader, IMessageHandler.THROW, null); this.world.setBehaveInJava5Way(true); PatternParser patternParser = new PatternParser(typePatternExpression); TypePattern typePattern = patternParser.parseTypePattern(); typePattern.resolve(this.world); IScope scope = new SimpleScope(this.world, new FormalBinding[0]); this.typePattern = typePattern.resolveBindings(scope, Bindings.NONE, false, false); }