org.nanocontainer.aop.dynaop
Class DynaopPointcutsFactory

java.lang.Object
  extended byorg.nanocontainer.aop.defaults.AbstractPointcutsFactory
      extended byorg.nanocontainer.aop.dynaop.DynaopPointcutsFactory
All Implemented Interfaces:
PointcutsFactory

public class DynaopPointcutsFactory
extends AbstractPointcutsFactory

Implements the org.nanocontainer.aop.PointcutsFactory interface using dynaop.

Version:
$Revision: 3144 $
Author:
Stephen Molitor

Constructor Summary
DynaopPointcutsFactory()
           
 
Method Summary
 ClassPointcut allClasses()
          Returns a class pointcut that picks all classes.
 MethodPointcut allMethods()
          Returns a pointcut that matches all methods.
 ClassPointcut className(java.lang.String regex)
          Returns a class pointcut that matches class names with a regular expression.
 MethodPointcut declaringClass(ClassPointcut classPointcut)
          Returns a method pointcut that picks a method if the given class pointcut picks the method's declaring class.
 MethodPointcut getMethods()
          Returns a pointcut that matches get methods.
 ClassPointcut instancesOf(java.lang.Class type)
          Returns a class pointcut that picks all instances of a given type.
 ClassPointcut intersection(ClassPointcut a, ClassPointcut b)
          Returns a class pointcut that is the intersection of two class pointcuts.
 MethodPointcut intersection(MethodPointcut a, MethodPointcut b)
          Returns a method pointcut that is the intersection of two other method pointcuts.
 MethodPointcut isMethods()
          Returns a pointcut that matches is methods.
 MethodPointcut membersOf(java.lang.Class clazz)
          Picks methods that are members of the given class (even if the method was declared in a super class of the given class).
 ClassPointcut not(ClassPointcut classPointcut)
          Returns a class pointcut that inverts the original pointcut.
 MethodPointcut not(MethodPointcut methodPointcut)
          Creates a method pointcut that inverts the original pointcut.
 MethodPointcut objectMethods()
          Returns a method pointcut that picks equals, hashCode, and toString.
 ClassPointcut oneClass(java.lang.Class clazz)
          Returns a class pointcut that picks one class.
 MethodPointcut oneMethod(java.lang.reflect.Method method)
          Returns a pointcut that matches one method.
 ClassPointcut packageName(java.lang.String packageName)
          Returns a class pointcut that picks all classes in a package.
 MethodPointcut returnType(ClassPointcut classPointcut)
          Returns a method pointcut that picks a method if the given class pointcut picks the method's return type.
 MethodPointcut setMethods()
          Returns a method pointcut that matches set methods.
 MethodPointcut signature(java.lang.String regexp)
          Returns a method pointcut that matches the method signatures with a regular expression.
 ClassPointcut union(ClassPointcut a, ClassPointcut b)
          Returns a pointcut that is the union of two class pointcuts.
 MethodPointcut union(MethodPointcut a, MethodPointcut b)
          Returns a method pointcut that is the union of two other method pointcuts.
 
Methods inherited from class org.nanocontainer.aop.defaults.AbstractPointcutsFactory
component, componentName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynaopPointcutsFactory

public DynaopPointcutsFactory()
Method Detail

allClasses

public ClassPointcut allClasses()
Description copied from interface: PointcutsFactory
Returns a class pointcut that picks all classes.

Returns:
a ClassPointcut that matches all classes.

instancesOf

public ClassPointcut instancesOf(java.lang.Class type)
Description copied from interface: PointcutsFactory
Returns a class pointcut that picks all instances of a given type.

Parameters:
type - the base interface or class.
Returns:
a ClassPointcut that matches instances of type.

className

public ClassPointcut className(java.lang.String regex)
Description copied from interface: PointcutsFactory
Returns a class pointcut that matches class names with a regular expression. The regular expression must be an ORO Perl5 regular expression.

Parameters:
regex - the regular expression to match against.
Returns:
a ClassPointcut that matches the class name against regex.

oneClass

public ClassPointcut oneClass(java.lang.Class clazz)
Description copied from interface: PointcutsFactory
Returns a class pointcut that picks one class.

Parameters:
clazz - the class to match against.
Returns:
a ClassPointcut that matches clazz.

packageName

public ClassPointcut packageName(java.lang.String packageName)
Description copied from interface: PointcutsFactory
Returns a class pointcut that picks all classes in a package. Note that the packageName argument is not a regular expression; the returned pointcut expects an exact match against the package name.

Parameters:
packageName - the package name to match against the package of the candidate component's class.
Returns:
a ClassPointcut that matches the class package with packageName.

intersection

public ClassPointcut intersection(ClassPointcut a,
                                  ClassPointcut b)
Description copied from interface: PointcutsFactory
Returns a class pointcut that is the intersection of two class pointcuts.

Parameters:
a - the first ClassPointcut.
b - the second ClassPointcut.
Returns:
a ClassPointcut that is the intersection of a and b.

union

public ClassPointcut union(ClassPointcut a,
                           ClassPointcut b)
Description copied from interface: PointcutsFactory
Returns a pointcut that is the union of two class pointcuts.

Parameters:
a - the first ClassPointcut.
b - the second ClassPointcut.
Returns:
a ClassPointcut that is the union of a and b.

not

public ClassPointcut not(ClassPointcut classPointcut)
Description copied from interface: PointcutsFactory
Returns a class pointcut that inverts the original pointcut.

Parameters:
classPointcut - the pointcut to negate.
Returns:
a ClassPointcut that inverts classPointcut.

allMethods

public MethodPointcut allMethods()
Description copied from interface: PointcutsFactory
Returns a pointcut that matches all methods.

Returns:
a MethodPointcut that matches all methods.

getMethods

public MethodPointcut getMethods()
Description copied from interface: PointcutsFactory
Returns a pointcut that matches get methods. Note that this does not include 'is' methods.

Returns:
a MethodPointcut that matches get methods.

isMethods

public MethodPointcut isMethods()
Description copied from interface: PointcutsFactory
Returns a pointcut that matches is methods.

Returns:
a MethodPointcut that matches is methods.

setMethods

public MethodPointcut setMethods()
Description copied from interface: PointcutsFactory
Returns a method pointcut that matches set methods.

Returns:
a MethodPointcut that matches set methods.

objectMethods

public MethodPointcut objectMethods()
Description copied from interface: PointcutsFactory
Returns a method pointcut that picks equals, hashCode, and toString.

Returns:
a MethodPointcut that matches methods declared by java.lang.Object.

returnType

public MethodPointcut returnType(ClassPointcut classPointcut)
Description copied from interface: PointcutsFactory
Returns a method pointcut that picks a method if the given class pointcut picks the method's return type.

Parameters:
classPointcut - the class pointcut to match against the method's return type.
Returns:
a MethodPointcut that matches classPointcut against the method's return type

signature

public MethodPointcut signature(java.lang.String regexp)
Description copied from interface: PointcutsFactory
Returns a method pointcut that matches the method signatures with a regular expression. Uses dynaop's signature pointcut. Method signatures follow this pattern:

 

ReturnType methodName(ArgumentType, ArgumentType, ...) throws ExceptionType, ExceptionType

Omits "java.lang." from classes in java.lang package. The regular expression must be an ORO Perl5 regular expression.

Parameters:
regexp - the method signature regular expression.
Returns:
a MethodPointcut that matches the method signature against a regular expression.

oneMethod

public MethodPointcut oneMethod(java.lang.reflect.Method method)
Description copied from interface: PointcutsFactory
Returns a pointcut that matches one method.

Parameters:
method - the method to match against.
Returns:
a MethodPointcut that matches one method.

declaringClass

public MethodPointcut declaringClass(ClassPointcut classPointcut)
Description copied from interface: PointcutsFactory
Returns a method pointcut that picks a method if the given class pointcut picks the method's declaring class.

Parameters:
classPointcut - the class pointcut to match against the method's declaring class.
Returns:
a MethodPointcut that matches classPointcut against the method's declaring class.

membersOf

public MethodPointcut membersOf(java.lang.Class clazz)
Description copied from interface: PointcutsFactory
Picks methods that are members of the given class (even if the method was declared in a super class of the given class).

Parameters:
clazz - the class that we will check to see if the method is a member of.
Returns:
a MethodPointcut that will check to see if the method is a member of clazz.

intersection

public MethodPointcut intersection(MethodPointcut a,
                                   MethodPointcut b)
Description copied from interface: PointcutsFactory
Returns a method pointcut that is the intersection of two other method pointcuts.

Parameters:
a - the first method pointcut.
b - the second method pointcut.
Returns:
a MethodPointcut that is the intersection of a and b.

union

public MethodPointcut union(MethodPointcut a,
                            MethodPointcut b)
Description copied from interface: PointcutsFactory
Returns a method pointcut that is the union of two other method pointcuts.

Parameters:
a - the first method pointcut.
b - the second method pointcut.
Returns:
a MethodPointcut that is the union of a and b.

not

public MethodPointcut not(MethodPointcut methodPointcut)
Description copied from interface: PointcutsFactory
Creates a method pointcut that inverts the original pointcut.

Parameters:
methodPointcut - the pointcut to negate.
Returns:
a new MethodPointcut that inverts methodPointcut.


Copyright © 2003-2007 Codehaus. All Rights Reserved.