public class P6Util extends Object
Constructor and Description |
---|
P6Util() |
Modifier and Type | Method and Description |
---|---|
static int |
atoi(Object s) |
static File |
classLoadPropertyFile(URL purl) |
static String |
classPathFile(String file)
Here we attempt to find the file in the current dir and the classpath
If we can't find it then we return null
|
static String |
dynamicGet(Class klass,
String property)
A utility for dynamically getting the value of a given static class
method
|
static Collection |
dynamicGetOptions(Class klass) |
static void |
dynamicSet(Class klass,
String property,
String value)
A utility for dynamically setting the value of a given static class
method
|
static long |
elapsed(Date start) |
static ArrayList |
findAllMethods(Class klass) |
static Class |
forName(String name)
A utiltity for using the current class loader (rather than the
system class loader) when instantiating a new class.
|
static Object |
get(Class klass,
String method) |
protected static String |
getCheckedPath() |
protected static String |
getClassPathAsString(ClassLoader classLoader) |
static String |
getPath(URL theURL) |
static PrintStream |
getPrintStream(String file,
boolean append) |
static boolean |
isTrue(String s,
boolean defaultValue) |
static Properties |
loadProperties(String file) |
static ArrayList |
loadProperties(String file,
String prefix) |
static int |
parseInt(String i,
int defaultValue) |
static long |
parseLong(String l,
long defaultValue) |
protected static void |
removeDots(Properties props) |
static ArrayList |
reverseArrayList(ArrayList arraylist) |
static void |
set(Class klass,
String method,
Object[] args) |
static Date |
timeNow() |
static String |
timeTaken(Date start,
String msg) |
public static int parseInt(String i, int defaultValue)
public static long parseLong(String l, long defaultValue)
public static boolean isTrue(String s, boolean defaultValue)
public static int atoi(Object s)
public static Properties loadProperties(String file)
protected static void removeDots(Properties props)
protected static String getCheckedPath()
protected static String getClassPathAsString(ClassLoader classLoader)
public static String classPathFile(String file)
public static Date timeNow()
public static PrintStream getPrintStream(String file, boolean append) throws IOException
IOException
public static long elapsed(Date start)
public static Class forName(String name) throws ClassNotFoundException
The idea is that the thread's current loader might have an obscure notion of what your class path is (e.g. an app server) that will not be captured properly by the system class loader.
taken from http://sourceforge.net/forum/message.php?msg_id=1720229
name
- class name to loadClassNotFoundException
public static void dynamicSet(Class klass, String property, String value)
public static void set(Class klass, String method, Object[] args) throws IntrospectionException, IllegalAccessException, NoSuchMethodException, InvocationTargetException
public static String dynamicGet(Class klass, String property)
public static Object get(Class klass, String method) throws IntrospectionException, IllegalAccessException, NoSuchMethodException, InvocationTargetException
public static Collection dynamicGetOptions(Class klass)
public static ArrayList findAllMethods(Class klass) throws IntrospectionException
IntrospectionException