package net.sf.crispy;
import java.lang.reflect.Method;
/**
* Structure for filter interceptors, with information about the method-invocation, how method and args.
*
* @author Linke
*
*/
public class InterceptorFilterContext {
private Class invocationClass = null;
private Method method = null;
private Object[] args = null;
private Throwable throwable = null;
public InterceptorFilterContext() {
super();
}
public InterceptorFilterContext(Class pvClass) {
this.setInvocationClass(pvClass);
}
public InterceptorFilterContext(Throwable pvThrowable) {
this.setThrowable(pvThrowable);
}
public Object[] getArgs() { return args; }
public void setArgs(final Object[] pvArgs) { args = pvArgs; }
public Method getMethod() { return method; }
public void setMethod(final Method pvMethod) { method = pvMethod; }
public Throwable getThrowable() { return throwable; }
public final void setThrowable(final Throwable pvThrowable) { throwable = pvThrowable; }
public Class getInvocationClass() {
Class lvClass = null;
if ((invocationClass == null) && (method != null)) {
lvClass = method.getDeclaringClass();
} else {
lvClass = invocationClass;
}
return lvClass;
}
public final void setInvocationClass(final Class pvClass) { invocationClass = pvClass; }
}
|