org.mockejb.interceptor
Class PointcutPair

java.lang.Object
  extended byorg.mockejb.interceptor.PointcutPair
All Implemented Interfaces:
Pointcut

public class PointcutPair
extends java.lang.Object
implements Pointcut

Provides a way to create conditional expressions from pointcuts.

Author:
Alexander Ananiev

Method Summary
static PointcutPair and(Pointcut pointcut1, Pointcut pointcut2)
          Creates a new instance of PointcutPair.
 boolean equals(java.lang.Object obj)
          Returns true if the given object is of the same type and it has the same pattern.
 int hashCode()
           
 boolean matchesJointpoint(java.lang.reflect.Method method)
          Tests if both poincuts match
static PointcutPair or(Pointcut pointcut1, Pointcut pointcut2)
          Creates a new instance of PointcutPair.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

and

public static PointcutPair and(Pointcut pointcut1,
                               Pointcut pointcut2)
Creates a new instance of PointcutPair. AND condition will be used by "matchesJointpoint".

Parameters:
pointcut1 - first pointcut
pointcut2 - second pointcut

or

public static PointcutPair or(Pointcut pointcut1,
                              Pointcut pointcut2)
Creates a new instance of PointcutPair. OR condition will be used by "matchesJointpoint".

Parameters:
pointcut1 - first pointcut
pointcut2 - second pointcut

matchesJointpoint

public boolean matchesJointpoint(java.lang.reflect.Method method)
Tests if both poincuts match

Specified by:
matchesJointpoint in interface Pointcut
Parameters:
method - method being invoked
Returns:
true if the provided method should be intercepted

equals

public boolean equals(java.lang.Object obj)
Returns true if the given object is of the same type and it has the same pattern.


hashCode

public int hashCode()