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 public void setNegate(boolean pvNegate) { negate = pvNegate; } 19 public boolean getNegate() { return negate; } 20 21 22 protected boolean negate (boolean pvValue) { 23 boolean ret = pvValue; 24 if (getNegate() == true) { 25 if (ret == true) { 26 ret = false; 27 } else { 28 ret = true; 29 } 30 } 31 return ret; 32 } 33 34 public abstract boolean accept(InterceptorFilterContext pvContext); 35 36 }