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