Author: markt Date: Thu Apr 9 16:20:23 2009 New Revision: 763723 URL: http://svn.apache.org/viewvc?rev=763723&view=rev Log: Drop some unused methods
Modified: tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java Modified: tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java?rev=763723&r1=763722&r2=763723&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java Thu Apr 9 16:20:23 2009 @@ -701,117 +701,11 @@ return getClassPath(jarsV); } - // -------------------- Mapping command line params to setters - - public static boolean processArgs(Object proxy, String args[]) - throws Exception { - String args0[] = null; - if (null != findMethod(proxy.getClass(), "getOptions1", new Class[] {})) { - args0 = (String[]) callMethod0(proxy, "getOptions1"); - } - - if (args0 == null) { - //args0=findVoidSetters(proxy.getClass()); - args0 = findBooleanSetters(proxy.getClass()); - } - Hashtable<Object,Object> h = null; - if (null != findMethod(proxy.getClass(), "getOptionAliases", - new Class[] {})) { - h = (Hashtable<Object,Object>) callMethod0(proxy, - "getOptionAliases"); - } - return processArgs(proxy, args, args0, null, h); - } - - public static boolean processArgs(Object proxy, String args[], - String args0[], String args1[], - Hashtable<Object,Object> aliases) throws Exception { - for (int i = 0; i < args.length; i++) { - String arg = args[i]; - if (arg.startsWith("-")) - arg = arg.substring(1); - if (aliases != null && aliases.get(arg) != null) - arg = (String) aliases.get(arg); - - if (args0 != null) { - boolean set = false; - for (int j = 0; j < args0.length; j++) { - if (args0[j].equalsIgnoreCase(arg)) { - setProperty(proxy, args0[j], "true"); - set = true; - break; - } - } - if (set) - continue; - } - if (args1 != null) { - for (int j = 0; j < args1.length; j++) { - if (args1[j].equalsIgnoreCase(arg)) { - i++; - if (i >= args.length) - return false; - setProperty(proxy, arg, args[i]); - break; - } - } - } else { - // if args1 is not specified,assume all other options have param - i++; - if (i >= args.length) - return false; - setProperty(proxy, arg, args[i]); - } - - } - return true; - } - // -------------------- other utils -------------------- public static void clear() { objectMethods.clear(); } - public static String[] findVoidSetters(Class<?> c) { - Method m[] = findMethods(c); - if (m == null) - return null; - Vector<String> v = new Vector<String>(); - for (int i = 0; i < m.length; i++) { - if (m[i].getName().startsWith("set") - && m[i].getParameterTypes().length == 0) { - String arg = m[i].getName().substring(3); - v.addElement(unCapitalize(arg)); - } - } - String s[] = new String[v.size()]; - for (int i = 0; i < s.length; i++) { - s[i] = v.elementAt(i); - } - return s; - } - - public static String[] findBooleanSetters(Class<?> c) { - Method m[] = findMethods(c); - if (m == null) - return null; - Vector<String> v = new Vector<String>(); - for (int i = 0; i < m.length; i++) { - if (m[i].getName().startsWith("set") - && m[i].getParameterTypes().length == 1 - && "boolean".equalsIgnoreCase(m[i].getParameterTypes()[0] - .getName())) { - String arg = m[i].getName().substring(3); - v.addElement(unCapitalize(arg)); - } - } - String s[] = new String[v.size()]; - for (int i = 0; i < s.length; i++) { - s[i] = v.elementAt(i); - } - return s; - } - static Hashtable<Class<?>,Method[]> objectMethods = new Hashtable<Class<?>,Method[]>(); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org