Class org.as2lib.aop.pointcut.KindedPointcut

org.as2lib.core.BasicClass
   +--org.as2lib.aop.pointcut.KindedPointcut

Implemented Interfaces

Pointcut

Description

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 AbstractJoinPoint#METHOD, AbstractJoinPoint#PROPERTY, AbstractJoinPoint#GET_PROPERTY, AbstractJoinPoint#SET_PROPERTY and 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 '..'.

Method Index

new KindedPointcut()

captures()

Inherited from BasicClass

toString()

Constructor Detail

KindedPointcut

public 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

joinPointPatternthe join point pattern
matchingJoinPointTypesthe types of the join points that match this pointcut

Method Detail

captures

public 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

joinPointthe join point to check whether it is captured by this pointcut

Return

true if the given joinPoint is captured else false

Specified By

captures() in org.as2lib.aop.Pointcut