| java.lang.Object de.fho.jump.pirol.utilities.Properties.PropertiesHandler
PropertiesHandler | public class PropertiesHandler implements de.fho.jump.pirol.utilities.apiTools.HandlerToMakeYourLifeEasier(Code) | | Class that enables easy access for reading and writing properties files.
author: Ole Rahn author:
author: FH Osnabrück - University of Applied Sciences Osnabrück, author: Project: PIROL (2005), author: Subproject: Daten- und Wissensmanagement version: $Rev: 856 $ |
Constructor Summary | |
public | PropertiesHandler(String propertiesFileName) Constructor
Parameters: propertiesFileName - the file name (with out path!) of the properties file, that is to be read or written. |
propertiesFileEnding | final public static String propertiesFileEnding(Code) | | |
PropertiesHandler | public PropertiesHandler(String propertiesFileName)(Code) | | Constructor
Parameters: propertiesFileName - the file name (with out path!) of the properties file, that is to be read or written. It will automatically be placed in the config directory. See Also: PirolPlugInSettings.configDirectory |
getAll | public Map<String, Object> getAll()(Code) | | get all properties as Map object (e.g. to feed into an other map...)
|
getPropertiesFile | public String getPropertiesFile()(Code) | | the file name of the properties file handled by this instance |
getPropertyAsBoolean | public boolean getPropertyAsBoolean(String key)(Code) | | Gets the property value with the key key and parses it
to an boolean if possible. An exception will be thrown,
if this key is not found within the properties and if the value could not
be parsed as desired.
Parameters: key - the key to get the value of the value of the property |
getPropertyAsBoolean | public boolean getPropertyAsBoolean(String key, boolean defaultValue)(Code) | | Gets the property value with the key key and parses it
to an boolean if possible.
If this key is not found within the properties the given default-Value will be returned.
An exception will be thrown, if the value is existent, but could not be parsed as desired.
Parameters: key - the key to get the value of Parameters: defaultValue - value to be filled in, if the given key wasn't found the value of the property |
getPropertyAsColor | public Color getPropertyAsColor(String key)(Code) | | Gets the property value with the key key and parses it
to a Color if possible. An exception will be thrown,
if this key is not found within the properties and if the value could not
be parsed as desired.
Parameters: key - the key to get the value of the value of the property |
getPropertyAsColor | public Color getPropertyAsColor(String key, Color defaultValue)(Code) | | Gets the property value with the key key and parses it
to a Color if possible.
If this key is not found within the properties the given default-Value will be returned.
An exception will be thrown, if the value is existent, but could not be parsed as desired.
Parameters: key - the key to get the value of Parameters: defaultValue - value to be filled in, if the given key wasn't found the value of the property |
getPropertyAsDouble | public double getPropertyAsDouble(String key)(Code) | | Gets the property value with the key key and parses it
to a double if possible. An exception will be thrown,
if this key is not found within the properties and if the value could not
be parsed as desired.
Parameters: key - the key to get the value of the value of the property |
getPropertyAsDouble | public double getPropertyAsDouble(String key, double defaultValue)(Code) | | Gets the property value with the key key and parses it
to a double if possible.
If this key is not found within the properties the given default-Value will be returned.
An exception will be thrown, if the value is existent, but could not be parsed as desired.
Parameters: key - the key to get the value of Parameters: defaultValue - value to be filled in, if the given key wasn't found the value of the property |
getPropertyAsInt | public int getPropertyAsInt(String key)(Code) | | Gets the property value with the key key and parses it
to an int if possible. An exception will be thrown,
if this key is not found within the properties and if the value could not
be parsed as desired.
Parameters: key - the key to get the value of the value of the property |
getPropertyAsInt | public int getPropertyAsInt(String key, int defaultValue)(Code) | | Gets the property value with the key key and parses it
to an int if possible.
If this key is not found within the properties the given default-Value will be returned.
An exception will be thrown, if the value is existent, but could not be parsed as desired.
Parameters: key - the key to get the value of Parameters: defaultValue - value to be filled in, if the given key wasn't found the value of the property |
setProperty | public Object setProperty(String key, String value)(Code) | | Sets a property key-value pair, replaces a pair with the same key!
Parameters: key - the key for the pair Parameters: value - the value return value like Properties would return See Also: Properties |
setProperty | public Object setProperty(String key, Color value)(Code) | | Sets a property key-value pair, replaces a pair with the same key!
Parameters: key - the key for the pair Parameters: value - the value return value like Properties would return See Also: Properties |
store | public void store(String comments) throws IOException(Code) | | Stores the current properties map to the file.
Parameters: comments - comments that will appear in the first lines of the file throws: IOException - |
|
|