org.codehaus.aspectwerkz.pointcut
Class MethodPointcut

java.lang.Object
  extended byorg.codehaus.aspectwerkz.pointcut.AbstractPointcut
      extended byorg.codehaus.aspectwerkz.pointcut.MethodPointcut
All Implemented Interfaces:
Pointcut

public class MethodPointcut
extends AbstractPointcut

Implements the pointcut concept for method access. Is an abstraction of a well defined point of execution in the program.
Could matches one or many points as long as they are well defined.
Stores the advices for the specific pointcut.

Author:
Jonas Bonér

Constructor Summary
MethodPointcut(java.lang.String expression)
          Creates a new method pointcut.
MethodPointcut(java.lang.String uuid, java.lang.String expression)
          Creates a new method pointcut.
 
Method Summary
 void addPointcutDef(PointcutDefinition pointcut)
          Adds a new pointcut pattern.
 boolean isNonReentrant()
          Checks if the pointcut is non-reentrant.
 boolean matches(ClassMetaData classMetaData, MethodMetaData methodMetaData)
          Checks if the pointcut matches a certain join point.
static boolean matchMethodPointcutSuperClasses(org.apache.commons.jexl.JexlContext jexlContext, java.lang.String name, ClassMetaData classMetaData, MethodMetaData methodMetaData, PointcutPatternTuple pointcutPattern)
          Tries to finds a match at some superclass in the hierarchy.
static boolean matchMethodPointcutSuperClasses(java.lang.String name, ClassMetaData classMetaData, PointcutPatternTuple pointcutPattern)
          Tries to finds a match at some superclass in the hierarchy.
 
Methods inherited from class org.codehaus.aspectwerkz.pointcut.AbstractPointcut
addAdvice, addAdvices, getAdviceIndex, getAdviceIndexes, getAdviceIndexTuples, getAdviceNames, getExpression, hasAdvice, removeAdvice, setAdviceIndexTuples
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodPointcut

public MethodPointcut(java.lang.String expression)
Creates a new method pointcut.

Parameters:
expression - the expression for the pointcut

MethodPointcut

public MethodPointcut(java.lang.String uuid,
                      java.lang.String expression)
Creates a new method pointcut.

Parameters:
uuid - the UUID for the AspectWerkz system
expression - the expression of the pointcut
Method Detail

isNonReentrant

public boolean isNonReentrant()
Checks if the pointcut is non-reentrant.

Returns:
the non-reentrancy flag

addPointcutDef

public void addPointcutDef(PointcutDefinition pointcut)
Adds a new pointcut pattern.

Parameters:
pointcut - the pointcut definition

matches

public boolean matches(ClassMetaData classMetaData,
                       MethodMetaData methodMetaData)
Checks if the pointcut matches a certain join point.

Parameters:
methodMetaData - the meta-data for the method
Returns:
boolean

matchMethodPointcutSuperClasses

public static boolean matchMethodPointcutSuperClasses(java.lang.String name,
                                                      ClassMetaData classMetaData,
                                                      PointcutPatternTuple pointcutPattern)
Tries to finds a match at some superclass in the hierarchy. Only checks for a class match to allow early filtering. Recursive.

Parameters:
name - the name of the pointcut to evaluate
classMetaData - the class meta-data
pointcutPattern - the pointcut pattern
Returns:
boolean

matchMethodPointcutSuperClasses

public static boolean matchMethodPointcutSuperClasses(org.apache.commons.jexl.JexlContext jexlContext,
                                                      java.lang.String name,
                                                      ClassMetaData classMetaData,
                                                      MethodMetaData methodMetaData,
                                                      PointcutPatternTuple pointcutPattern)
Tries to finds a match at some superclass in the hierarchy. Recursive.

Parameters:
jexlContext - the Jexl context
name - the name of the pointcut to evaluate
classMetaData - the class meta-data
methodMetaData - the method meta-data
pointcutPattern - the pointcut pattern
Returns:
boolean


Copyright (c) 2002-2004 The AspectWerkz Team. All Rights Reserved.