Top Fields Constructors Methods
ch.qos.logback.core.util

public Class OptionHelper

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, java.util.Properties, ch.qos.logback.core.Context, ch.qos.logback.core.spi.ContextAware, .PropertyContainer, .ScanException, ch.qos.logback.core.subst.NodeToStringTransformer

Author
Ceki Gulcu

Field Summary

Modifier and TypeField and Description
pack-priv static final String
pack-priv static final String
pack-priv static final int
pack-priv static final String
DELIM_START

Find the value corresponding to key in props.

pack-priv static final int
pack-priv static final char
pack-priv static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String[]
extractDefaultReplacement(String key)

Return a String[] of size two.

public static String

Returns:

value corresponding to key from the OS environment
getEnv
(String key)

Lookup a key from the environment.

public static Properties

Returns:

the system properties
getSystemProperties
()

Very similar to System#getProperties() except that the SecurityException is absorbed.

public static String

Returns:

the string value of the system property, or the default value if there is no property with that key.
getSystemProperty
(String
The key to search for.
key
,
String
The default value to return.
def
)

Very similar to System.getProperty except that the SecurityException is absorbed.

public static String

Returns:

the string value of the system property.
getSystemProperty
(String
The key to search for.
key
)

Very similar to System.getProperty except that the SecurityException is absorbed.

public static Object
instantiateByClassName(String className, Class<?> superClass, Context context)

public static Object
instantiateByClassName(String className, Class<?> superClass, ClassLoader classLoader)

public static Object
instantiateByClassNameAndParameter(String className, Class<?> superClass, Context context, Class<?> type, Object param)

public static Object
instantiateByClassNameAndParameter(String className, Class<?> superClass, ClassLoader classLoader, Class<?> type, Object parameter)

public static boolean
isEmpty(String str)

Deprecated
public static final boolean
isNotEmtpy(Object[] array)

public static boolean
isNullOrEmpty(String str)

Returns true if input str is null or empty.

public static final boolean
public static boolean
isNullOrEmptyOrAllSpaces(String str)

isNullOrEmpty xisNullOrEmptyOrAllSpaces

public static String
public static void
public static void
setSystemProperty(ContextAware contextAware, String key, String value)

public static String
public static String
substVars(String input, PropertyContainer pc0, PropertyContainer pc1)

See http://logback.qos.ch/manual/configuration.html#variableSubstitution

public static boolean
toBoolean(String value, boolean dEfault)

If value is "true", then true is returned.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_IS_UNDEFINEDback to summary
pack-priv static final String _IS_UNDEFINED
DELIM_DEFAULTback to summary
pack-priv static final String DELIM_DEFAULT
DELIM_DEFAULT_LENback to summary
pack-priv static final int DELIM_DEFAULT_LEN
DELIM_STARTback to summary
pack-priv static final String DELIM_START

Find the value corresponding to key in props. Then perform variable substitution on the found value.

DELIM_START_LENback to summary
pack-priv static final int DELIM_START_LEN
DELIM_STOPback to summary
pack-priv static final char DELIM_STOP
DELIM_STOP_LENback to summary
pack-priv static final int DELIM_STOP_LEN

Constructor Detail

OptionHelperback to summary
public OptionHelper()

Method Detail

extractDefaultReplacementback to summary
public static String[] extractDefaultReplacement(String key)

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.

getEnvback to summary
public static String getEnv(String key)

Lookup a key from the environment.

Returns:String

value corresponding to key from the OS environment

getSystemPropertiesback to summary
public static Properties getSystemProperties()

Very similar to System#getProperties() except that the SecurityException is absorbed.

Returns:Properties

the system properties

getSystemPropertyback to summary
public static String getSystemProperty(String key, String def)

Very similar to System.getProperty except that the SecurityException is absorbed.

Parameters
key:String

The key to search for.

def:String

The default value to return.

Returns:String

the string value of the system property, or the default value if there is no property with that key.

getSystemPropertyback to summary
public static String getSystemProperty(String key)

Very similar to System.getProperty except that the SecurityException is absorbed.

Parameters
key:String

The key to search for.

Returns:String

the string value of the system property.

instantiateByClassNameback to summary
public static Object instantiateByClassName(String className, Class<?> superClass, Context context) throws IncompatibleClassException, DynamicClassLoadingException
instantiateByClassNameback to summary
public static Object instantiateByClassName(String className, Class<?> superClass, ClassLoader classLoader) throws IncompatibleClassException, DynamicClassLoadingException
instantiateByClassNameAndParameterback to summary
public static Object instantiateByClassNameAndParameter(String className, Class<?> superClass, Context context, Class<?> type, Object param) throws IncompatibleClassException, DynamicClassLoadingException
instantiateByClassNameAndParameterback to summary
public static Object instantiateByClassNameAndParameter(String className, Class<?> superClass, ClassLoader classLoader, Class<?> type, Object parameter) throws IncompatibleClassException, DynamicClassLoadingException
isEmptyback to summary
public static boolean isEmpty(String str)

Deprecated

Since
1.3
isNotEmtpyback to summary
public static final boolean isNotEmtpy(Object[] array)
isNullOrEmptyback to summary
public static boolean isNullOrEmpty(String str)

Returns true if input str is null or empty.

isNullOrEmptyback to summary
public static final boolean isNullOrEmpty(Object[] array)
isNullOrEmptyOrAllSpacesback to summary
public static boolean isNullOrEmptyOrAllSpaces(String str)

isNullOrEmpty xisNullOrEmptyOrAllSpaces

Since
1.5.0
propertyLookupback to summary
public static String propertyLookup(String key, PropertyContainer pc1, PropertyContainer pc2)
setSystemPropertiesback to summary
public static void setSystemProperties(ContextAware contextAware, Properties props)
setSystemPropertyback to summary
public static void setSystemProperty(ContextAware contextAware, String key, String value)
substVarsback to summary
public static String substVars(String val, PropertyContainer pc1) throws ScanException
See Also
substVars(String, PropertyContainer, PropertyContainer)
substVarsback to summary
public static String substVars(String input, PropertyContainer pc0, PropertyContainer pc1) throws ScanException

See http://logback.qos.ch/manual/configuration.html#variableSubstitution

toBooleanback to summary
public static boolean toBoolean(String value, boolean dEfault)

If value is "true", then true is returned. If value is "false", then true is returned. Otherwise, default is returned.

Case of value is unimportant.