public class P6Util
extends java.lang.Object
Constructor and Description |
---|
P6Util() |
Modifier and Type | Method and Description |
---|---|
static int |
atoi(java.lang.Object s) |
static java.io.File |
classLoadPropertyFile(java.net.URL purl) |
static java.lang.String |
classPathFile(java.lang.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 java.lang.String |
dynamicGet(java.lang.Class klass,
java.lang.String property)
A utility for dynamically getting the value of a given static class
method
|
static java.util.Collection |
dynamicGetOptions(java.lang.Class klass) |
static void |
dynamicSet(java.lang.Class klass,
java.lang.String property,
java.lang.String value)
A utility for dynamically setting the value of a given static class
method
|
static long |
elapsed(java.util.Date start) |
static java.util.ArrayList |
findAllMethods(java.lang.Class klass) |
static java.lang.Class |
forName(java.lang.String name)
A utiltity for using the current class loader (rather than the
system class loader) when instantiating a new class.
|
static java.lang.Object |
get(java.lang.Class klass,
java.lang.String method) |
protected static java.lang.String |
getCheckedPath() |
protected static java.lang.String |
getClassPathAsString(java.lang.ClassLoader classLoader) |
static java.lang.String |
getPath(java.net.URL theURL) |
static java.io.PrintStream |
getPrintStream(java.lang.String file,
boolean append) |
static boolean |
isTrue(java.lang.String s,
boolean defaultValue) |
static java.util.Properties |
loadProperties(java.lang.String file) |
static java.util.ArrayList |
loadProperties(java.lang.String file,
java.lang.String prefix) |
static int |
parseInt(java.lang.String i,
int defaultValue) |
static long |
parseLong(java.lang.String l,
long defaultValue) |
protected static void |
removeDots(java.util.Properties props) |
static java.util.ArrayList |
reverseArrayList(java.util.ArrayList arraylist) |
static void |
set(java.lang.Class klass,
java.lang.String method,
java.lang.Object[] args) |
static java.util.Date |
timeNow() |
static java.lang.String |
timeTaken(java.util.Date start,
java.lang.String msg) |
public static int parseInt(java.lang.String i, int defaultValue)
public static long parseLong(java.lang.String l, long defaultValue)
public static boolean isTrue(java.lang.String s, boolean defaultValue)
public static int atoi(java.lang.Object s)
public static java.util.Properties loadProperties(java.lang.String file)
protected static void removeDots(java.util.Properties props)
protected static java.lang.String getCheckedPath()
protected static java.lang.String getClassPathAsString(java.lang.ClassLoader classLoader)
public static java.util.ArrayList loadProperties(java.lang.String file, java.lang.String prefix)
public static java.util.ArrayList reverseArrayList(java.util.ArrayList arraylist)
public static java.lang.String classPathFile(java.lang.String file)
public static java.io.File classLoadPropertyFile(java.net.URL purl)
public static java.util.Date timeNow()
public static java.io.PrintStream getPrintStream(java.lang.String file, boolean append) throws java.io.IOException
java.io.IOException
public static java.lang.String timeTaken(java.util.Date start, java.lang.String msg)
public static long elapsed(java.util.Date start)
public static java.lang.Class forName(java.lang.String name) throws java.lang.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 loadjava.lang.ClassNotFoundException
public static void dynamicSet(java.lang.Class klass, java.lang.String property, java.lang.String value)
public static void set(java.lang.Class klass, java.lang.String method, java.lang.Object[] args) throws java.beans.IntrospectionException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
java.beans.IntrospectionException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
public static java.lang.String dynamicGet(java.lang.Class klass, java.lang.String property)
public static java.lang.Object get(java.lang.Class klass, java.lang.String method) throws java.beans.IntrospectionException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
java.beans.IntrospectionException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
public static java.util.Collection dynamicGetOptions(java.lang.Class klass)
public static java.util.ArrayList findAllMethods(java.lang.Class klass) throws java.beans.IntrospectionException
java.beans.IntrospectionException
public static java.lang.String getPath(java.net.URL theURL)