package org.mockejb.interceptor;
import java.lang.reflect.Method;
public class ClassPatternPointcut implements Pointcut {
private RegexpWrapper regexpWrapper;
public ClassPatternPointcut( String regexpPattern ){
regexpWrapper = new RegexpWrapper( regexpPattern );
}
public boolean matchesJointpoint( Method method ) {
return regexpWrapper.containedInString( method.toString() );
}
public boolean equals( Object obj ){
if ( ! (obj instanceof ClassPatternPointcut) )
return false;
ClassPatternPointcut classPatternPointcut = (ClassPatternPointcut ) obj;
return ( regexpWrapper.equals( classPatternPointcut.regexpWrapper ));
}
public int hashCode() {
return regexpWrapper.hashCode();
}
}