Home » apache-tomcat-6.0.26-src » org.apache » tomcat » util » [javadoc | source]
org.apache.tomcat.util
public final class: IntrospectionUtils [javadoc | source]
java.lang.Object
   org.apache.tomcat.util.IntrospectionUtils
Utils for introspection and reflection
Nested Class Summary:
public static interface  IntrospectionUtils.PropertySource   
public static interface  IntrospectionUtils.AttributeHolder   
Field Summary
public static  String PATH_SEPARATOR     
static  Hashtable objectMethods     
static  Object[] emptyArray     
static final  int dbg     
Method from org.apache.tomcat.util.IntrospectionUtils Summary:
addJarsFromClassPath,   addToClassPath,   addToolsJar,   callMain,   callMethod0,   callMethod1,   callMethodN,   capitalize,   classPathAdd,   clear,   convert,   d,   displayClassPath,   execute,   findBooleanSetters,   findMethod,   findMethods,   findVoidSetters,   getAttribute,   getClassPath,   getClassPath,   getFilesByExt,   getProperty,   getURL,   getURLClassLoader,   guessInstall,   guessInstall,   hasHook,   processArgs,   processArgs,   replaceProperties,   replaceProperties,   setAttribute,   setProperty,   setProperty,   setProperty,   unCapitalize
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.util.IntrospectionUtils Detail:
 public static  void addJarsFromClassPath(Vector jars,
    String cp) throws IOException, MalformedURLException 
    Add elements from the classpath cp to a Vector jars as file URLs (We use Vector for JDK 1.1 compat).

 public static  void addToClassPath(Vector cpV,
    String dir) 
    Add all the jar files in a dir to the classpath, represented as a Vector of URLs.
 public static  void addToolsJar(Vector v) 
 public static  void callMain(Class c,
    String[] args) throws Exception 
 public static Object callMethod0(Object target,
    String methodN) throws Exception 
 public static Object callMethod1(Object target,
    String methodN,
    Object param1,
    String typeParam1,
    ClassLoader cl) throws Exception 
 public static Object callMethodN(Object target,
    String methodN,
    Object[] params,
    Class[] typeParams) throws Exception 
 public static String capitalize(String name) 
    Reverse of Introspector.decapitalize
 public static String classPathAdd(URL[] urls,
    String cp) 
    Adds classpath entries from a vector of URL's to the "tc_path_add" System property. This System property lists the classpath entries common to web applications. This System property is currently used by Jasper when its JSP servlet compiles the Java file for a JSP.
 public static  void clear() 
 public static Object convert(String object,
    Class paramType) 
 static  void d(String s) 
 public static  void displayClassPath(String msg,
    URL[] cp) 
    Debug method, display the classpath
 public static  void execute(Object proxy,
    String method) throws Exception 
    Call execute() - any ant-like task should work
 public static String[] findBooleanSetters(Class c) 
 public static Method findMethod(Class c,
    String name,
    Class[] params) 
 public static Method[] findMethods(Class c) 
 public static String[] findVoidSetters(Class c) 
 public static Object getAttribute(Object proxy,
    String n) throws Exception 
    Call void getAttribute( String )
 public static URL[] getClassPath(Vector v) 
    Return a URL[] that can be used to construct a class loader
 public static URL[] getClassPath(String dir,
    String cpath,
    String cpathProp,
    boolean addTools) throws IOException, MalformedURLException 
    Construct a URL classpath from files in a directory, a cpath property, and tools.jar.
 public static String[] getFilesByExt(String ld,
    String ext) 
    Return all files with a given extension in a dir
 public static Object getProperty(Object o,
    String name) 
 public static URL getURL(String base,
    String file) 
    Construct a file url from a file, using a base dir
 public static ClassLoader getURLClassLoader(URL[] urls,
    ClassLoader parent) 
    Construct a URLClassLoader. Will compile and work in JDK1.1 too.
 public static String guessInstall(String installSysProp,
    String homeSysProp,
    String jarName) 
 public static String guessInstall(String installSysProp,
    String homeSysProp,
    String jarName,
    String classFile) 
    Guess a product install/home by analyzing the class path. It works for product using the pattern: lib/executable.jar or if executable.jar is included in classpath by a shell script. ( java -jar also works ) Insures both "install" and "home" System properties are set. If either or both System properties are unset, "install" and "home" will be set to the same value. This value will be the other System property that is set, or the guessed value if neither is set.
 public static boolean hasHook(Object obj,
    String methodN) 
    Test if the object implements a particular method
 public static boolean processArgs(Object proxy,
    String[] args) throws Exception 
 public static boolean processArgs(Object proxy,
    String[] args,
    String[] args0,
    String[] args1,
    Hashtable aliases) throws Exception 
 public static String replaceProperties(String value,
    Object getter) 
Deprecated! Use - the explicit method

    Replace ${NAME} with the property value
 public static String replaceProperties(String value,
    Hashtable staticProp,
    PropertySource[] dynamicProp) 
    Replace ${NAME} with the property value
 public static  void setAttribute(Object proxy,
    String n,
    Object v) throws Exception 
    Call void setAttribute( String ,Object )
 public static  void setProperty(Object o,
    String name) 
 public static boolean setProperty(Object o,
    String name,
    String value) 
    Find a method with the right name If found, call the method ( if param is int or boolean we'll convert value to the right type before) - that means you can have setDebug(1).
 public static boolean setProperty(Object o,
    String name,
    String value,
    boolean invokeSetProperty) 
 public static String unCapitalize(String name)