1 16 17 package org.apache.commons.jexl.util; 18 19 import org.apache.commons.logging.Log; 20 34 public class BooleanPropertyExecutor extends PropertyExecutor { 35 36 44 public BooleanPropertyExecutor(Log rlog, 45 org.apache.commons.jexl.util.introspection.Introspector is, 46 Class clazz, String property) { 47 super(rlog, is, clazz, property); 48 } 49 50 56 protected void discover(Class clazz, String property) { 57 try { 58 char c; 59 StringBuffer sb; 60 61 Object [] params = {}; 62 63 66 67 sb = new StringBuffer ("is"); 68 sb.append(property); 69 70 c = sb.charAt(2); 71 72 if (Character.isLowerCase(c)) { 73 sb.setCharAt(2, Character.toUpperCase(c)); 74 } 75 76 methodUsed = sb.toString(); 77 method = introspector.getMethod(clazz, methodUsed, params); 78 79 if (method != null) { 80 83 84 if (method.getReturnType() == Boolean.TYPE) { 85 return; 86 } 87 88 method = null; 89 } 90 } catch (Exception e) { 91 rlog.error("PROGRAMMER ERROR : BooleanPropertyExector() : " + e); 92 } 93 } 94 } 95 | Popular Tags |