Package biz.onixs.util.settings
Class PropertyBasedSettings
- java.lang.Object
-
- biz.onixs.util.settings.Settings
-
- biz.onixs.util.settings.PropertyBasedSettings
-
public class PropertyBasedSettings extends Settings
The Settings implementation backed with thePropertiesclass. The keys values are case-sensitive.
-
-
Constructor Summary
Constructors Constructor Description PropertyBasedSettings()Constructor.PropertyBasedSettings(String resource)Constructor.PropertyBasedSettings(String... resources)Constructor.PropertyBasedSettings(String name, boolean isFile)Constructor.PropertyBasedSettings(Properties properties)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidloadAsFile(String fileName)Loads settings from the file system resource.voidloadAsResource(String resourceName)Loads settings from the classpath resource.-
Methods inherited from class biz.onixs.util.settings.Settings
getBoolean, getBoolean, getInteger, getInteger, getLong, getLong, getString, getString, isDefined, setBoolean, setBoolean, setInteger, setInteger, setLong, setLong, setString, setString
-
-
-
-
Constructor Detail
-
PropertyBasedSettings
public PropertyBasedSettings()
Constructor.
-
PropertyBasedSettings
public PropertyBasedSettings(Properties properties)
Constructor.- Parameters:
properties- properties to init settings with
-
PropertyBasedSettings
public PropertyBasedSettings(String... resources)
Constructor.Loads settings resource using default lookup schema.
- Parameters:
resources- resource name to load and init settings with
-
PropertyBasedSettings
public PropertyBasedSettings(String resource)
Constructor.Loads settings resource using default lookup schema.
- Parameters:
resource- resource name to load and init settings with
-
PropertyBasedSettings
public PropertyBasedSettings(String name, boolean isFile)
Constructor.- Parameters:
name- resource or file name to load and init settings withisFile- flag to define whether the specified name is file or resource
-
-
Method Detail
-
loadAsFile
public void loadAsFile(String fileName)
Loads settings from the file system resource.- Parameters:
fileName- file with settings to load
-
loadAsResource
public void loadAsResource(String resourceName)
Loads settings from the classpath resource.- Parameters:
resourceName- resource name with settings to load
-
-