java.lang.Object
ch.qos.logback.core.util.OptionHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]Return a String[] of size two.static StringLookup a key from the environment.static PropertiesVery similar toSystem.getProperties()except that theSecurityExceptionis absorbed.static StringgetSystemProperty(String key) Very similar toSystem.getPropertyexcept that theSecurityExceptionis absorbed.static StringgetSystemProperty(String key, String def) Very similar toSystem.getPropertyexcept that theSecurityExceptionis absorbed.static ObjectinstantiateByClassName(String className, Class<?> superClass, Context context) static ObjectinstantiateByClassName(String className, Class<?> superClass, ClassLoader classLoader) static ObjectinstantiateByClassNameAndParameter(String className, Class<?> superClass, Context context, Class<?> type, Object param) static ObjectinstantiateByClassNameAndParameter(String className, Class<?> superClass, ClassLoader classLoader, Class<?> type, Object parameter) static booleanDeprecated.static final booleanisNotEmtpy(Object[] array) static final booleanisNullOrEmpty(Object[] array) static booleanisNullOrEmpty(String str) Returns true if input str is null or empty.static booleanisNullOrEmpty xisNullOrEmptyOrAllSpacesstatic StringpropertyLookup(String key, PropertyContainer pc1, PropertyContainer pc2) static voidsetSystemProperties(ContextAware contextAware, Properties props) static voidsetSystemProperty(ContextAware contextAware, String key, String value) static StringsubstVars(String val, PropertyContainer pc1) static StringsubstVars(String input, PropertyContainer pc0, PropertyContainer pc1) See http://logback.qos.ch/manual/configuration.html#variableSubstitutionstatic booleanIfvalueis "true", thentrueis returned.
-
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
- Throws:
ScanException- See Also:
-
substVars
public static String substVars(String input, PropertyContainer pc0, PropertyContainer pc1) throws ScanException See http://logback.qos.ch/manual/configuration.html#variableSubstitution- Throws:
ScanException
-
propertyLookup
-
getSystemProperty
Very similar toSystem.getPropertyexcept that theSecurityExceptionis 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
-
getSystemProperty
Very similar toSystem.getPropertyexcept that theSecurityExceptionis 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 theSecurityExceptionis 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
-
isEmpty
-
isNullOrEmpty
Returns true if input str is null or empty.- Parameters:
str-- Returns:
-
isNullOrEmptyOrAllSpaces
isNullOrEmpty xisNullOrEmptyOrAllSpaces- Parameters:
str-- Returns:
- Since:
- 1.5.0
-
isNullOrEmpty
-
isNotEmtpy
-