Access keys

KindedPointcut

Kind of class: class
Inherits from: BasicClass
Implements:
Author: Simon Wacker
Classpath: org.as2lib.aop.pointcut.KindedPointcut
File last modified: Monday, 15 August 2005, 10:17:46
KindedPointcut represents any kinded pointcuts.
These are for example
execution, set and get access pointcuts.

Kinded pointcuts build upon a join point pattern and a specific join point type.
Pre-defined join point types are org.as2lib.aop.joinpoint.AbstractJoinPoint.METHOD,
org.as2lib.aop.joinpoint.AbstractJoinPoint.PROPERTY, org.as2lib.aop.joinpoint.AbstractJoinPoint.GET_PROPERTY,
org.as2lib.aop.joinpoint.AbstractJoinPoint.SET_PROPERTY and org.as2lib.aop.joinpoint.AbstractJoinPoint.CONSTRUCTOR.
You may combine several join point types with a bitwise or "|" to make this kinded
pointcut match all the combined join point types.

The pattern may consist of wildcards. Using wildcards you can capture join points
based on specific characteristics like capture every setter method contained in every
class whose name starts with "Abstract" in the org.as2lib.env package
and every sub-package. Such a pattern would look something like this:
org.as2lib.env..Abstract*.set*

You already see two wildcards there: '*' and '..'.

  • '*' indicates any number of characters excluding the period.
  • '..' indicates any number of charecters including all periods.
  • '+' indicates all subclasses or subinterfaces of a given type.
  • '!' negates the match; match all join points except the ones that match the
    pattern.

Summary

Constructor
Instance methods
Instance methods inherited from BasicClass

Constructor

KindedPointcut

function KindedPointcut (
joinPointPattern:String, matchingJoinPointTypes:Number)
Constructs a new KindedPointcut instance.

Depending on the join points matches method a pattern of value
null or undefined will cause the captures method to
return true or false. Note that the join point implementations
provided by this framework return true for a null pattern.

A matching join point type of value null or undefined is
interpreted as "any type of join point allowed".

matchingJoinPointTypes can be either only one type or a bitwise or "|"
combination of several types. It is thus possible to make this kinded pointcut
match more than one join point type.
AbstractJoinPoint.METHOD | AbstractJoinPoint.CONSTRUCTOR

Parameters:
joinPointPattern :
the join point pattern
matchingJoinPointTypes:
the types of the join points that match this
pointcut

Instance methods

captures

function captures (
joinPoint:JoinPoint) : Boolean
Checks whether the given joinPoint is captured by this pointcut. This is
normally the case if the join point is of the correct type and the pattern
matches the join point.

false will be returned if:
  • The passed-in join point is null or undefined.
  • The passed-in join point does not match the given join point pattern.
  • The passed-in join point's type does not match the given one.
Parameters:
joinPoint:
the join point to check whether it is captured by this pointcut
Returns:
true if the given joinPoint is captured else false