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