1 12 13 package com.openedit.util.strainer; 14 15 import com.openedit.WebPageRequest; 16 17 18 23 public class ContextVariableFilter implements Filter 24 { 25 protected String fieldEquals; 26 protected String fieldProperty; 27 28 33 public ContextVariableFilter() 34 { 35 super(); 36 } 37 38 44 public ContextVariableFilter(String inPermission, String inEQ) 45 { 46 setProperty(inPermission); 47 setEquals(inEQ); 48 } 49 50 55 public void setEquals(String inString) 56 { 57 fieldEquals = inString; 58 } 59 60 65 public String getEquals() 66 { 67 return fieldEquals; 68 } 69 70 75 public void setProperty(String permission) 76 { 77 fieldProperty = permission; 78 } 79 80 85 public String getProperty() 86 { 87 return fieldProperty; 88 } 89 90 93 public boolean passes(Object inObj) throws FilterException, ClassCastException 94 { 95 WebPageRequest req = (WebPageRequest) inObj; 96 97 String compare = (String ) req.getPageValue(getProperty()); 98 99 return (getProperty() == null) || getEquals().equalsIgnoreCase(compare); 100 } 101 102 public void accept( FilterVisitor inFilterVisitor ) throws FilterException 103 { 104 106 } 107 108 public Filter[] getFilters() 109 { 110 return null; 112 } 113 } 114 | Popular Tags |