|
1 |
| package net.sf.crispy.filter; |
|
2 |
| |
|
3 |
| import net.sf.crispy.InterceptorFilter; |
|
4 |
| import net.sf.crispy.InterceptorFilterContext; |
|
5 |
| |
|
6 |
| public abstract class AbstractInterceptorFilter implements InterceptorFilter { |
|
7 |
| |
|
8 |
| public static final int FILTER_TYPE_NO = 0; |
|
9 |
| public static final int FILTER_TYPE_METHOD = 1; |
|
10 |
| public static final int FILTER_TYPE_CLASS = 2; |
|
11 |
| public static final int FILTER_TYPE_THROWABLE = 3; |
|
12 |
| |
|
13 |
| |
|
14 |
| private boolean negate = false; |
|
15 |
| protected int filterObjectsType = FILTER_TYPE_NO; |
|
16 |
| |
|
17 |
| |
|
18 |
6
| public void setNegate(boolean pvNegate) { negate = pvNegate; }
|
|
19 |
106
| public boolean getNegate() { return negate; }
|
|
20 |
| |
|
21 |
| |
|
22 |
106
| protected boolean negate (boolean pvValue) {
|
|
23 |
106
| boolean ret = pvValue;
|
|
24 |
106
| if (getNegate() == true) {
|
|
25 |
17
| if (ret == true) {
|
|
26 |
7
| ret = false;
|
|
27 |
| } else { |
|
28 |
10
| ret = true;
|
|
29 |
| } |
|
30 |
| } |
|
31 |
106
| return ret;
|
|
32 |
| } |
|
33 |
| |
|
34 |
| public abstract boolean accept(InterceptorFilterContext pvContext); |
|
35 |
| |
|
36 |
| } |