public class OptionHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static java.lang.String |
_IS_UNDEFINED |
(package private) static java.lang.String |
DELIM_DEFAULT |
(package private) static int |
DELIM_DEFAULT_LEN |
(package private) static java.lang.String |
DELIM_START
Find the value corresponding to
key in props. |
(package private) static int |
DELIM_START_LEN |
(package private) static char |
DELIM_STOP |
(package private) static int |
DELIM_STOP_LEN |
| Constructor and Description |
|---|
OptionHelper() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String[] |
extractDefaultReplacement(java.lang.String key)
Return a String[] of size two.
|
static java.lang.String |
getEnv(java.lang.String key)
Lookup a key from the environment.
|
static java.util.Properties |
getSystemProperties()
Very similar to
System.getProperties() except that the
SecurityException is absorbed. |
static java.lang.String |
getSystemProperty(java.lang.String key)
Very similar to
System.getProperty except that the
SecurityException is absorbed. |
static java.lang.String |
getSystemProperty(java.lang.String key,
java.lang.String def)
Very similar to
System.getProperty except that the
SecurityException is absorbed. |
static java.lang.Object |
instantiateByClassName(java.lang.String className,
java.lang.Class<?> superClass,
java.lang.ClassLoader classLoader) |
static java.lang.Object |
instantiateByClassName(java.lang.String className,
java.lang.Class<?> superClass,
Context context) |
static java.lang.Object |
instantiateByClassNameAndParameter(java.lang.String className,
java.lang.Class<?> superClass,
java.lang.ClassLoader classLoader,
java.lang.Class<?> type,
java.lang.Object parameter) |
static java.lang.Object |
instantiateByClassNameAndParameter(java.lang.String className,
java.lang.Class<?> superClass,
Context context,
java.lang.Class<?> type,
java.lang.Object param) |
static boolean |
isEmpty(java.lang.String str) |
static java.lang.String |
propertyLookup(java.lang.String key,
PropertyContainer pc1,
PropertyContainer pc2) |
static void |
setSystemProperties(ContextAware contextAware,
java.util.Properties props) |
static void |
setSystemProperty(ContextAware contextAware,
java.lang.String key,
java.lang.String value) |
static java.lang.String |
substVars(java.lang.String val,
PropertyContainer pc1) |
static java.lang.String |
substVars(java.lang.String input,
PropertyContainer pc0,
PropertyContainer pc1)
See http://logback.qos.ch/manual/configuration.html#variableSubstitution
|
static boolean |
toBoolean(java.lang.String value,
boolean dEfault)
If
value is "true", then true is returned. |
static final java.lang.String DELIM_START
key in props.
Then perform variable substitution on the found value.static final char DELIM_STOP
static final java.lang.String DELIM_DEFAULT
static final int DELIM_START_LEN
static final int DELIM_STOP_LEN
static final int DELIM_DEFAULT_LEN
static final java.lang.String _IS_UNDEFINED
public static java.lang.Object instantiateByClassName(java.lang.String className,
java.lang.Class<?> superClass,
Context context)
throws IncompatibleClassException,
DynamicClassLoadingException
public static java.lang.Object instantiateByClassNameAndParameter(java.lang.String className,
java.lang.Class<?> superClass,
Context context,
java.lang.Class<?> type,
java.lang.Object param)
throws IncompatibleClassException,
DynamicClassLoadingException
public static java.lang.Object instantiateByClassName(java.lang.String className,
java.lang.Class<?> superClass,
java.lang.ClassLoader classLoader)
throws IncompatibleClassException,
DynamicClassLoadingException
public static java.lang.Object instantiateByClassNameAndParameter(java.lang.String className,
java.lang.Class<?> superClass,
java.lang.ClassLoader classLoader,
java.lang.Class<?> type,
java.lang.Object parameter)
throws IncompatibleClassException,
DynamicClassLoadingException
public static java.lang.String substVars(java.lang.String val,
PropertyContainer pc1)
public static java.lang.String substVars(java.lang.String input,
PropertyContainer pc0,
PropertyContainer pc1)
public static java.lang.String propertyLookup(java.lang.String key,
PropertyContainer pc1,
PropertyContainer pc2)
public static java.lang.String getSystemProperty(java.lang.String key,
java.lang.String def)
System.getProperty except that the
SecurityException is absorbed.key - The key to search for.def - The default value to return.public static java.lang.String getEnv(java.lang.String key)
key - public static java.lang.String getSystemProperty(java.lang.String key)
System.getProperty except that the
SecurityException is absorbed.key - The key to search for.public static void setSystemProperties(ContextAware contextAware, java.util.Properties props)
public static void setSystemProperty(ContextAware contextAware, java.lang.String key, java.lang.String value)
public static java.util.Properties getSystemProperties()
System.getProperties() except that the
SecurityException is absorbed.public static java.lang.String[] extractDefaultReplacement(java.lang.String key)
key - public static boolean toBoolean(java.lang.String value,
boolean dEfault)
value is "true", then true is returned. If
value is "false", then true is returned.
Otherwise, default is returned.
Case of value is unimportant.
public static boolean isEmpty(java.lang.String str)