Package ch.qos.logback.core.util
Class OptionHelper
java.lang.Object
ch.qos.logback.core.util.OptionHelper
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String
(package private) static final String
(package private) static final int
(package private) static final String
Find the value corresponding tokey
inprops
.(package private) static final int
(package private) static final char
(package private) static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
Return a String[] of size two.static String
Lookup a key from the environment.static Properties
Very similar toSystem.getProperties()
except that theSecurityException
is absorbed.static String
getSystemProperty
(String key) Very similar toSystem.getProperty
except that theSecurityException
is absorbed.static String
getSystemProperty
(String key, String def) Very similar toSystem.getProperty
except that theSecurityException
is absorbed.static Object
instantiateByClassName
(String className, Class<?> superClass, Context context) static Object
instantiateByClassName
(String className, Class<?> superClass, ClassLoader classLoader) static Object
instantiateByClassNameAndParameter
(String className, Class<?> superClass, Context context, Class<?> type, Object param) static Object
instantiateByClassNameAndParameter
(String className, Class<?> superClass, ClassLoader classLoader, Class<?> type, Object parameter) static boolean
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#variableSubstitutionstatic boolean
Ifvalue
is "true", thentrue
is returned.
-
Field Details
-
DELIM_START
Find the value corresponding tokey
inprops
. Then perform variable substitution on the found value.- See Also:
-
DELIM_STOP
static final char DELIM_STOP- See Also:
-
DELIM_DEFAULT
- See Also:
-
DELIM_START_LEN
static final int DELIM_START_LEN- See Also:
-
DELIM_STOP_LEN
static final int DELIM_STOP_LEN- See Also:
-
DELIM_DEFAULT_LEN
static final int DELIM_DEFAULT_LEN- See Also:
-
_IS_UNDEFINED
- See Also:
-
-
Constructor Details
-
OptionHelper
public OptionHelper()
-
-
Method Details
-
instantiateByClassName
public static Object instantiateByClassName(String className, Class<?> superClass, Context context) throws IncompatibleClassException, DynamicClassLoadingException -
instantiateByClassNameAndParameter
public static Object instantiateByClassNameAndParameter(String className, Class<?> superClass, Context context, Class<?> type, Object param) throws IncompatibleClassException, DynamicClassLoadingException -
instantiateByClassName
public static Object instantiateByClassName(String className, Class<?> superClass, ClassLoader classLoader) throws IncompatibleClassException, DynamicClassLoadingException -
instantiateByClassNameAndParameter
public static Object instantiateByClassNameAndParameter(String className, Class<?> superClass, ClassLoader classLoader, Class<?> type, Object parameter) throws IncompatibleClassException, DynamicClassLoadingException -
substVars
- See Also:
-
substVars
See http://logback.qos.ch/manual/configuration.html#variableSubstitution -
propertyLookup
-
getSystemProperty
Very similar toSystem.getProperty
except that theSecurityException
is absorbed.- Parameters:
key
- The key to search for.def
- The default value to return.- Returns:
- the string value of the system property, or the default value if there is no property with that key.
-
getEnv
Lookup a key from the environment.- Parameters:
key
-- Returns:
- value corresponding to key from the OS environment
-
getSystemProperty
Very similar toSystem.getProperty
except that theSecurityException
is absorbed.- Parameters:
key
- The key to search for.- Returns:
- the string value of the system property.
-
setSystemProperties
-
setSystemProperty
-
getSystemProperties
Very similar toSystem.getProperties()
except that theSecurityException
is absorbed.- Returns:
- the system properties
-
extractDefaultReplacement
Return a String[] of size two. The first item containing the key part and the second item containing a default value specified by the user. The second item will be null if no default value is specified.- Parameters:
key
-- Returns:
-
toBoolean
Ifvalue
is "true", thentrue
is returned. Ifvalue
is "false", thentrue
is returned. Otherwise,default
is returned.Case of value is unimportant.
-
isEmpty
-