public class OptionHelper extends Object
| Constructor and Description |
|---|
OptionHelper()
|
| Modifier and Type | Method and Description |
|---|---|
static String |
extractDefaultReplacement(String
Return a String[] of size two.
|
static String |
getEnv(String
Lookup a key from the environment.
|
static Properties |
getSystemProperties()
Very similar to
System except that the
SecurityException is absorbed.
|
static String |
getSystemProperty(String
Very similar to
System.getProperty except that the
SecurityException is absorbed.
|
static String |
getSystemProperty(String
Very similar to
System.getProperty except that the
SecurityException is absorbed.
|
static Object |
instantiateByClassName(String
|
static Object |
instantiateByClassName(String
|
static Object |
instantiateByClassNameAndParameter(String
|
static Object |
instantiateByClassNameAndParameter(String
|
static boolean |
isEmpty(String
|
static String |
propertyLookup(String
|
static void |
setSystemProperties(ContextAware
|
static void |
setSystemProperty(ContextAware
|
static String |
substVars(String
|
static String |
substVars(String
See http://logback.qos.ch/manual/configuration.html#variableSubstitution
|
static boolean |
toBoolean(String
If
value is "true", then
true is returned.
|
public static ObjectinstantiateByClassName(String className, Class <?> superClass, Context context) throws IncompatibleClassException , DynamicClassLoadingException
public static ObjectinstantiateByClassNameAndParameter(String className, Class <?> superClass, Context context, Class <?> type, Object param) throws IncompatibleClassException , DynamicClassLoadingException
public static ObjectinstantiateByClassName(String className, Class <?> superClass, ClassLoader classLoader) throws IncompatibleClassException , DynamicClassLoadingException
public static ObjectinstantiateByClassNameAndParameter(String className, Class <?> superClass, ClassLoader classLoader, Class <?> type, Object parameter) throws IncompatibleClassException , DynamicClassLoadingException
public static StringsubstVars(String val, PropertyContainer pc1)
public static StringsubstVars(String input, PropertyContainer pc0, PropertyContainer pc1)
public static StringpropertyLookup(String key, PropertyContainer pc1, PropertyContainer pc2)
public static StringgetSystemProperty(String key, String def)
System.getProperty except that the
SecurityException is absorbed.
key - The key to search for.
def - The default value to return.
public static StringgetEnv(String key)
key -
public static StringgetSystemProperty(String key)
System.getProperty except that the
SecurityException is absorbed.
key - The key to search for.
public static void setSystemProperties(ContextAwarecontextAware, Properties props)
public static void setSystemProperty(ContextAwarecontextAware, String key, String value)
public static PropertiesgetSystemProperties()
System.getProperties() except that the
SecurityException is absorbed.
public static String[] extractDefaultReplacement(String key)
key -
public static boolean toBoolean(Stringvalue, 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(Stringstr)