Class ConfigurationUtil
- java.lang.Object
-
- org.apache.felix.webconsole.internal.servlet.ConfigurationUtil
-
public class ConfigurationUtil extends Object
A helper class to get configuration properties.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
getProperty(Map<String,Object> config, String name, boolean def)
Returns the value of the named property from the configuration.static int
getProperty(Map config, String name, int def)
Returns the named property from the configuration.static String
getProperty(Map config, String name, String def)
Returns the named property from the configuration.static int
getProperty(org.osgi.framework.BundleContext context, String name, int def)
Returns the named property from the framework.static String
getProperty(org.osgi.framework.BundleContext context, String name, String def)
Returns the named property from the framework.static String[]
getStringArrayProperty(Map config, String name)
Gets a property as String[]
-
-
-
Method Detail
-
getProperty
public static final String getProperty(org.osgi.framework.BundleContext context, String name, String def)
Returns the named property from the framework. If the property does not exist, the default valuedef
is returned.- Parameters:
context
- The BundleContext providing framework propertiesname
- The name of the property to returndef
- The default value if the named property does not exist- Returns:
- The value of the named property or
def
if the property does not exist
-
getProperty
public static final int getProperty(org.osgi.framework.BundleContext context, String name, int def)
Returns the named property from the framework. If the property does not exist, the default valuedef
is returned.- Parameters:
context
- The BundleContext providing framework propertiesname
- The name of the property to returndef
- The default value if the named property does not exist- Returns:
- The value of the named property as a string or
def
if the property does not exist
-
getProperty
public static final String getProperty(Map config, String name, String def)
Returns the named property from the configuration. If the property does not exist, the default valuedef
is returned.- Parameters:
config
- The properties from which to returned the named onename
- The name of the property to returndef
- The default value if the named property does not exist- Returns:
- The value of the named property as a string or
def
if the property does not exist
-
getProperty
public static final int getProperty(Map config, String name, int def)
Returns the named property from the configuration. If the property does not exist, the default valuedef
is returned.- Parameters:
config
- The properties from which to returned the named onename
- The name of the property to returndef
- The default value if the named property does not exist- Returns:
- The value of the named property as a string or
def
if the property does not exist
-
getStringArrayProperty
public static final String[] getStringArrayProperty(Map config, String name)
Gets a property as String[]- Parameters:
config
- The properties from which to returned the named onename
- The name of the property to return- Returns:
- the property value as string array - no matter if originally it was other kind of array, collection or comma-separated string. Returns
null
if the property is not set.
-
getProperty
public static boolean getProperty(Map<String,Object> config, String name, boolean def)
Returns the value of the named property from the configuration. If the property does not exist, the default valuedef
is returned.- Parameters:
config
- The properties from which to returned the named onename
- The name of the property to returndef
- The default value if the named property does not exist- Returns:
- The value of the named property as a boolean or
def
if the property does not exist
-
-