Top Description Fields Constructors Methods
org.aspectj.weaver.patterns

public Class PointcutRewriter

extends Object
Class Inheritance
Imports
java.util.Iterator, .Set, .SortedSet, .TreeSet, org.aspectj.weaver.Shadow, org.aspectj.weaver.patterns.Pointcut.MatchesNothingPointcut

Performs term rewriting for pointcut expressions.
Authors
colyer, clement

Field Summary

Modifier and TypeField and Description
private static final boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private void
public Pointcut
createAndsFor(Pointcut[] ps)

Passed an array of pointcuts, returns an AND tree with them in.

private Pointcut
public static String
format(Pointcut p)

Allows formatting of the output pointcut for debugging...

private boolean
private boolean
isDNF(Pointcut pc)

Check if a pointcut is in DNF - if it is then it should be lots of 'ORs' up the top with 'ANDs' beneath them.

private boolean
isDNFHelper(Pointcut pc, boolean canStillHaveOrs)

Helper function for determining DNFness.

private boolean
private boolean
public Pointcut
not(Pointcut p)

Returns a NOTted form of the pointcut p - we cope with already NOTted pointcuts.

private Pointcut
private Pointcut
removeNothings(Pointcut pc)

Removes MATCHES_NOTHING pointcuts

public Pointcut
rewrite(Pointcut pc, boolean forceRewrite)

Set forcerewrite if you want to override the checking for something already in DNF (useful for some testing) Repeated processing of something already in DNF is expensive (it ends up being done for every pointcut on every incremental compile) - so let's not do it if we don't have to.

public Pointcut
private Pointcut
private Pointcut
private Pointcut
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

WATCH_PROGRESSback to summary
private static final boolean WATCH_PROGRESS

Constructor Detail

PointcutRewriterback to summary
public PointcutRewriter()

Method Detail

collectAndNodesback to summary
private void collectAndNodes(AndPointcut apc, Set<Pointcut> nodesSoFar)
collectOrNodesback to summary
private void collectOrNodes(Pointcut pc, Set<Pointcut> nodesSoFar)
createAndsForback to summary
public Pointcut createAndsFor(Pointcut[] ps)

Passed an array of pointcuts, returns an AND tree with them in.

distributeNotback to summary
private Pointcut distributeNot(Pointcut pc)
formatback to summary
public static String format(Pointcut p)

Allows formatting of the output pointcut for debugging...

isAndback to summary
private boolean isAnd(Pointcut pc)
isDNFback to summary
private boolean isDNF(Pointcut pc)

Check if a pointcut is in DNF - if it is then it should be lots of 'ORs' up the top with 'ANDs' beneath them.

isDNFHelperback to summary
private boolean isDNFHelper(Pointcut pc, boolean canStillHaveOrs)

Helper function for determining DNFness. Records when we have crossed the point of allowing ORs.

isNotback to summary
private boolean isNot(Pointcut pc)
isOrback to summary
private boolean isOr(Pointcut pc)
notback to summary
public Pointcut not(Pointcut p)

Returns a NOTted form of the pointcut p - we cope with already NOTted pointcuts.

pullUpDisjunctionsback to summary
private Pointcut pullUpDisjunctions(Pointcut pc)
removeNothingsback to summary
private Pointcut removeNothings(Pointcut pc)

Removes MATCHES_NOTHING pointcuts

rewriteback to summary
public Pointcut rewrite(Pointcut pc, boolean forceRewrite)

Set forcerewrite if you want to override the checking for something already in DNF (useful for some testing) Repeated processing of something already in DNF is expensive (it ends up being done for every pointcut on every incremental compile) - so let's not do it if we don't have to. See pr113257

rewriteback to summary
public Pointcut rewrite(Pointcut pc)
simplifyAndback to summary
private Pointcut simplifyAnd(AndPointcut apc)
simplifyAndsback to summary
private Pointcut simplifyAnds(Pointcut pc)
sortOrsback to summary
private Pointcut sortOrs(Pointcut pc)