1 package net.sf.crispy;
2
3 import java.lang.reflect.Method;
4
5 /**
6 * Structure for filter interceptors, with information about the method-invocation, how method and args.
7 *
8 * @author Linke
9 *
10 */
11 public class InterceptorFilterContext {
12
13 private Class invocationClass = null;
14 private Method method = null;
15 private Object[] args = null;
16 private Throwable throwable = null;
17
18 public InterceptorFilterContext() {
19 super();
20 }
21 public InterceptorFilterContext(Class pvClass) {
22 this.setInvocationClass(pvClass);
23 }
24 public InterceptorFilterContext(Throwable pvThrowable) {
25 this.setThrowable(pvThrowable);
26 }
27
28 public Object[] getArgs() { return args; }
29 public void setArgs(final Object[] pvArgs) { args = pvArgs; }
30
31 public Method getMethod() { return method; }
32 public void setMethod(final Method pvMethod) { method = pvMethod; }
33
34 public Throwable getThrowable() { return throwable; }
35 public final void setThrowable(final Throwable pvThrowable) { throwable = pvThrowable; }
36
37 public Class getInvocationClass() {
38 Class lvClass = null;
39 if ((invocationClass == null) && (method != null)) {
40 lvClass = method.getDeclaringClass();
41 } else {
42 lvClass = invocationClass;
43 }
44 return lvClass;
45 }
46 public final void setInvocationClass(final Class pvClass) { invocationClass = pvClass; }
47
48 }