|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectice.util.Defs
| Field Summary | |
static byte[] |
EMPTY_BYTE_ARRAY
|
static char[] |
EMPTY_CHAR_ARRAY
|
static int[] |
EMPTY_INT_ARRAY
|
static long[] |
EMPTY_LONG_ARRAY
|
static Object[] |
EMPTY_OBJECT_ARRAY
|
static String |
EMPTY_STRING
|
static String[] |
EMPTY_STRING_ARRAY
|
static Object |
NO_SYNCHRONIZATION
Useful tag to explicitly indicate intention not to use any synchronization object locks instead of simply writing null when applicable |
static Object |
NOT_FOUND
Usefull tag to distinguish null value and value absence |
| Constructor Summary | |
Defs()
|
|
| Method Summary | |
static void |
badArg()
Convinient method to throw IllegalArgumentException |
static boolean |
booleanProperty(String name)
Shortcut for booleanProperty(name, false) |
static boolean |
booleanProperty(String name,
boolean defaultValue)
If security manager allow access to the system property name and it exists, then return true if it is set to yes, true and false if set to no, false. |
static Class |
getClass(String className)
Utility to return result of Class.forName(className) or null if it throws ClassNotFoundException or SecurityException |
static Method |
getMethod(Class sourceClass,
String name,
Class[] signature)
Utility to return result of sourceClass.getMethod(name, signature) or null if it throws NoSuchMethodException or SecurityException |
static Method |
getMethod(String className,
String name,
Class[] signature)
Utility to return result of Class.forName(className).getMethod(name, signature) or null if it throws exceptions |
static int |
intProperty(String name,
int defaultValue)
Return value for system property name parsed as int or
defaultValue if the property does not exist
or a security manager denies access to it |
static Object |
newClassInstance(Class cl)
Utility to return result of cl.newInstance() or null if it throws IllegalAccessException, InstantiationException, LinkageError or SecurityException |
static Object |
newClassInstance(String className)
|
static Object[] |
newObjectArray(int size)
Utility shortcut for: |
static String |
property(String name)
Equivalent to property(name, null) |
static String |
property(String name,
String defaultValue)
Return value for system property name or
defaultValue if the property does not exist
or a security manager denies access to it |
static void |
setProperty(String property,
String value)
Set system property to value. |
static void |
setSandBoxEnabled()
|
static void |
setSystemProperty(String name,
String value)
Set system property to value. |
static String |
sysProperty(String name)
Alias to property(String name) |
static String |
sysProperty(String name,
String defaultValue)
Alias to property(String name, String defaultValue) |
static boolean |
sysPropertyBoolean(String name)
Alias to booleanProperty(String name) |
static boolean |
sysPropertyBoolean(String name,
boolean defaultValue)
Alias to booleanProperty(String name, boolean defaultValue) |
static int |
sysPropertyInt(String name,
int defaultValue)
Alias to intProperty(String name, int defaultValue) |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final Object NOT_FOUND
public static final Object NO_SYNCHRONIZATION
public static final String EMPTY_STRING
public static final byte[] EMPTY_BYTE_ARRAY
public static final char[] EMPTY_CHAR_ARRAY
public static final int[] EMPTY_INT_ARRAY
public static final long[] EMPTY_LONG_ARRAY
public static final Object[] EMPTY_OBJECT_ARRAY
public static final String[] EMPTY_STRING_ARRAY
| Constructor Detail |
public Defs()
| Method Detail |
public static Object[] newObjectArray(int size)
(size != 0) ? new Object[size] : Defs.EMPTY_OBJECT_ARRAY;
public static String property(String name)
public static String property(String name,
String defaultValue)
name or
defaultValue if the property does not exist
or a security manager denies access to it
public static int intProperty(String name,
int defaultValue)
name parsed as int or
defaultValue if the property does not exist
or a security manager denies access to it
public static boolean booleanProperty(String name)
booleanProperty(name, false)
public static boolean booleanProperty(String name,
boolean defaultValue)
public static String sysProperty(String name)
public static String sysProperty(String name,
String defaultValue)
public static int sysPropertyInt(String name,
int defaultValue)
public static boolean sysPropertyBoolean(String name)
public static boolean sysPropertyBoolean(String name,
boolean defaultValue)
public static void setProperty(String property,
String value)
value.
If SecurityManager denies property modification, silently ignore
property change
public static void setSandBoxEnabled()
public static void setSystemProperty(String name,
String value)
value.
If SecurityManager denies property modification, print debug trace
public static Class getClass(String className)
Class.forName(className) or null if it throws ClassNotFoundException or SecurityException
public static Object newClassInstance(Class cl)
cl.newInstance() or null if it throws IllegalAccessException, InstantiationException, LinkageError or SecurityException
public static Object newClassInstance(String className)
public static Method getMethod(Class sourceClass,
String name,
Class[] signature)
sourceClass.getMethod(name, signature) or null if it throws NoSuchMethodException or SecurityException
public static Method getMethod(String className,
String name,
Class[] signature)
Class.forName(className).getMethod(name, signature) or null if it throws exceptions
public static void badArg()
throws IllegalArgumentException
IllegalArgumentException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||