|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lonniepryor.blues.aop.Pointcut
Specification interface for identifying JoinPoints. Instances of this class may be logically combined using the AND, OR, and NOT operations. Many common use-cases are supplied via static accessor methods.
Constructor Summary | |
protected |
Pointcut()
Creates a new Pointcut object. |
Method Summary | |
Pointcut |
and(Pointcut specification)
Returns a specification representing a logical AND of this specification on the left and the supplied specification on the right. |
protected abstract boolean |
evaluate(Aspect aspect,
JoinPoint joinPoint)
Returns true if the supplied join point satisfies this pointcut. |
static Pointcut |
invokeInstance(Strings specification)
Creates a new specification satisified by join points whose instance name satisfy the supplied specification. |
static Pointcut |
invokeMethod(Methods specification)
Creates a new specification satisified by join points whose target method satisfy the supplied specification. |
boolean |
isSatisfiedBy(Aspect aspect,
JoinPoint joinPoint)
Returns true if the parameters are not null and the supplied join point satisfies this pointcut. |
Pointcut |
not()
Returns a specification representing a logical NOT of this specification. |
Pointcut |
or(Pointcut specification)
Returns a specification representing a logical OR of this specification on the left and the supplied specification on the right. |
static Pointcut |
parse(java.lang.String pointcutPattern)
Parses a pattern consisting of a pointcut declaration. |
static Pointcut |
parseExpression(java.lang.String pointcutPatternExpr)
Parses a logical expression as described in the Expression class, using this class's parse() method for creating values. |
static Pointcut |
refrence(java.lang.String poincutName)
Creates a new specification satisified by join points that satisfy the named pointcut. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Pointcut()
Method Detail |
public static Pointcut invokeInstance(Strings specification)
specification
- The specification to test instance names with.
public static Pointcut invokeMethod(Methods specification)
specification
- The specification to test target methods with.
public static Pointcut refrence(java.lang.String poincutName)
poincutName
- The name of the pointcut to evaluate.
public static Pointcut parse(java.lang.String pointcutPattern)
pointcut ::= invoke-pointcut | named-pointcut invoke-pointcut ::= "invoke" "(" invoke-params ")" invoke-params ::= [ "[" instance-pattern "]" ] method-pattern. instance-pattern ::= A '/'-delimetedExample:TokenizedStrings
pattern expression. method-pattern ::= AMethods
pattern. named-pointcut ::= name "(" ")" name ::= Any valid Java name except "invoke".
invoke([aService || anotherService] void *(int, ..))The above creates a specification satisified by join points on instances named 'aService' or 'anotherService', with a target method that returns void and takes an int as its first parameter.
pointcutPattern
- The pattern definition string.
ParseException
- if the pattern is invalid.Methods.parse(String)
,
TokenizedStrings.parseExpression(String, char)
public static Pointcut parseExpression(java.lang.String pointcutPatternExpr)
pointcutPatternExpr
- The pattern expression definition string.
ParseException
- if the pattern expression is invalid.Expression
,
parse(String)
public final boolean isSatisfiedBy(Aspect aspect, JoinPoint joinPoint)
aspect
- The aspect to lookup refrenced pointcuts on.joinPoint
- The join point to evaluate.
protected abstract boolean evaluate(Aspect aspect, JoinPoint joinPoint)
aspect
- The aspect to lookup refrenced pointcuts on.joinPoint
- The join point to evaluate.
public final Pointcut and(Pointcut specification)
specification
- The specification to AND with.
public final Pointcut or(Pointcut specification)
specification
- The specification to OR with.
public final Pointcut not()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |