|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tomcat.util.IntrospectionUtils
public final class IntrospectionUtils
Utils for introspection and reflection
Nested Class Summary | |
---|---|
static interface |
IntrospectionUtils.AttributeHolder
|
static interface |
IntrospectionUtils.PropertySource
|
Field Summary | |
---|---|
static java.lang.String |
PATH_SEPARATOR
|
Constructor Summary | |
---|---|
IntrospectionUtils()
|
Method Summary | |
---|---|
static void |
addJarsFromClassPath(java.util.Vector jars,
java.lang.String cp)
Add elements from the classpath cp to a Vector jars as file URLs (We use Vector for JDK 1.1 compat). |
static void |
addToClassPath(java.util.Vector cpV,
java.lang.String dir)
Add all the jar files in a dir to the classpath, represented as a Vector of URLs. |
static void |
addToolsJar(java.util.Vector v)
|
static void |
callMain(java.lang.Class c,
java.lang.String[] args)
|
static java.lang.Object |
callMethod0(java.lang.Object target,
java.lang.String methodN)
|
static java.lang.Object |
callMethod1(java.lang.Object target,
java.lang.String methodN,
java.lang.Object param1,
java.lang.String typeParam1,
java.lang.ClassLoader cl)
|
static java.lang.Object |
callMethodN(java.lang.Object target,
java.lang.String methodN,
java.lang.Object[] params,
java.lang.Class[] typeParams)
|
static java.lang.String |
capitalize(java.lang.String name)
Reverse of Introspector.decapitalize |
static java.lang.String |
classPathAdd(java.net.URL[] urls,
java.lang.String cp)
Adds classpath entries from a vector of URL's to the "tc_path_add" System property. |
static void |
clear()
|
static java.lang.Object |
convert(java.lang.String object,
java.lang.Class paramType)
|
static void |
displayClassPath(java.lang.String msg,
java.net.URL[] cp)
Debug method, display the classpath |
static void |
execute(java.lang.Object proxy,
java.lang.String method)
Call execute() - any ant-like task should work |
static java.lang.String[] |
findBooleanSetters(java.lang.Class c)
|
static java.lang.reflect.Method |
findMethod(java.lang.Class c,
java.lang.String name,
java.lang.Class[] params)
|
static java.lang.reflect.Method[] |
findMethods(java.lang.Class c)
|
static java.lang.String[] |
findVoidSetters(java.lang.Class c)
|
static java.lang.Object |
getAttribute(java.lang.Object proxy,
java.lang.String n)
Call void getAttribute( String ) |
static java.net.URL[] |
getClassPath(java.lang.String dir,
java.lang.String cpath,
java.lang.String cpathProp,
boolean addTools)
Construct a URL classpath from files in a directory, a cpath property, and tools.jar. |
static java.net.URL[] |
getClassPath(java.util.Vector v)
Return a URL[] that can be used to construct a class loader |
static java.lang.String[] |
getFilesByExt(java.lang.String ld,
java.lang.String ext)
Return all files with a given extension in a dir |
static java.lang.Object |
getProperty(java.lang.Object o,
java.lang.String name)
|
static java.net.URL |
getURL(java.lang.String base,
java.lang.String file)
Construct a file url from a file, using a base dir |
static java.lang.ClassLoader |
getURLClassLoader(java.net.URL[] urls,
java.lang.ClassLoader parent)
Construct a URLClassLoader. |
static java.lang.String |
guessInstall(java.lang.String installSysProp,
java.lang.String homeSysProp,
java.lang.String jarName)
|
static java.lang.String |
guessInstall(java.lang.String installSysProp,
java.lang.String homeSysProp,
java.lang.String jarName,
java.lang.String classFile)
Guess a product install/home by analyzing the class path. |
static boolean |
hasHook(java.lang.Object obj,
java.lang.String methodN)
Test if the object implements a particular method |
static boolean |
processArgs(java.lang.Object proxy,
java.lang.String[] args)
|
static boolean |
processArgs(java.lang.Object proxy,
java.lang.String[] args,
java.lang.String[] args0,
java.lang.String[] args1,
java.util.Hashtable aliases)
|
static java.lang.String |
replaceProperties(java.lang.String value,
java.util.Hashtable staticProp,
IntrospectionUtils.PropertySource[] dynamicProp)
Replace ${NAME} with the property value |
static java.lang.String |
replaceProperties(java.lang.String value,
java.lang.Object getter)
Deprecated. Use the explicit method |
static void |
setAttribute(java.lang.Object proxy,
java.lang.String n,
java.lang.Object v)
Call void setAttribute( String ,Object ) |
static void |
setProperty(java.lang.Object o,
java.lang.String name)
|
static boolean |
setProperty(java.lang.Object o,
java.lang.String name,
java.lang.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). |
static boolean |
setProperty(java.lang.Object o,
java.lang.String name,
java.lang.String value,
boolean invokeSetProperty)
|
static java.lang.String |
unCapitalize(java.lang.String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String PATH_SEPARATOR
Constructor Detail |
---|
public IntrospectionUtils()
Method Detail |
---|
public static void execute(java.lang.Object proxy, java.lang.String method) throws java.lang.Exception
java.lang.Exception
public static void setAttribute(java.lang.Object proxy, java.lang.String n, java.lang.Object v) throws java.lang.Exception
java.lang.Exception
public static java.lang.Object getAttribute(java.lang.Object proxy, java.lang.String n) throws java.lang.Exception
java.lang.Exception
public static java.lang.ClassLoader getURLClassLoader(java.net.URL[] urls, java.lang.ClassLoader parent)
public static java.lang.String guessInstall(java.lang.String installSysProp, java.lang.String homeSysProp, java.lang.String jarName)
public static java.lang.String guessInstall(java.lang.String installSysProp, java.lang.String homeSysProp, java.lang.String jarName, java.lang.String classFile)
public static void displayClassPath(java.lang.String msg, java.net.URL[] cp)
public static java.lang.String classPathAdd(java.net.URL[] urls, java.lang.String cp)
public static boolean setProperty(java.lang.Object o, java.lang.String name, java.lang.String value)
public static boolean setProperty(java.lang.Object o, java.lang.String name, java.lang.String value, boolean invokeSetProperty)
public static java.lang.Object getProperty(java.lang.Object o, java.lang.String name)
public static void setProperty(java.lang.Object o, java.lang.String name)
public static java.lang.String replaceProperties(java.lang.String value, java.lang.Object getter)
public static java.lang.String replaceProperties(java.lang.String value, java.util.Hashtable staticProp, IntrospectionUtils.PropertySource[] dynamicProp)
public static java.lang.String capitalize(java.lang.String name)
public static java.lang.String unCapitalize(java.lang.String name)
public static void addToClassPath(java.util.Vector cpV, java.lang.String dir)
public static void addToolsJar(java.util.Vector v)
public static java.lang.String[] getFilesByExt(java.lang.String ld, java.lang.String ext)
public static java.net.URL getURL(java.lang.String base, java.lang.String file)
public static void addJarsFromClassPath(java.util.Vector jars, java.lang.String cp) throws java.io.IOException, java.net.MalformedURLException
jars
- The jar listcp
- a String classpath of directory or jar file elements
separated by path.separator delimiters.
java.io.IOException
- If an I/O error occurs
java.net.MalformedURLException
- Doh ;)public static java.net.URL[] getClassPath(java.util.Vector v)
public static java.net.URL[] getClassPath(java.lang.String dir, java.lang.String cpath, java.lang.String cpathProp, boolean addTools) throws java.io.IOException, java.net.MalformedURLException
java.io.IOException
java.net.MalformedURLException
public static boolean processArgs(java.lang.Object proxy, java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static boolean processArgs(java.lang.Object proxy, java.lang.String[] args, java.lang.String[] args0, java.lang.String[] args1, java.util.Hashtable aliases) throws java.lang.Exception
java.lang.Exception
public static void clear()
public static java.lang.String[] findVoidSetters(java.lang.Class c)
public static java.lang.String[] findBooleanSetters(java.lang.Class c)
public static java.lang.reflect.Method[] findMethods(java.lang.Class c)
public static java.lang.reflect.Method findMethod(java.lang.Class c, java.lang.String name, java.lang.Class[] params)
public static boolean hasHook(java.lang.Object obj, java.lang.String methodN)
public static void callMain(java.lang.Class c, java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static java.lang.Object callMethod1(java.lang.Object target, java.lang.String methodN, java.lang.Object param1, java.lang.String typeParam1, java.lang.ClassLoader cl) throws java.lang.Exception
java.lang.Exception
public static java.lang.Object callMethod0(java.lang.Object target, java.lang.String methodN) throws java.lang.Exception
java.lang.Exception
public static java.lang.Object callMethodN(java.lang.Object target, java.lang.String methodN, java.lang.Object[] params, java.lang.Class[] typeParams) throws java.lang.Exception
java.lang.Exception
public static java.lang.Object convert(java.lang.String object, java.lang.Class paramType)
|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |