Class PropertyService
java.lang.Object
net.sourceforge.jbizmo.commons.property.PropertyService
Simple utility that provides methods to access properties. Note that some properties have to be provided in a predefined format within the properties file: java.util.Date: "dd.MM.yyyy HH:mm:ss" double: "0.00" float: "0.00" Furthermore it is important that the application that uses this service has to provide a property file at a predefined location within the library!
Copyright 2010 (C) by Martin Ganserer
- Version:
- 1.0.0
- Author:
- Martin Ganserer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBooleanProperty(String name) Get a property of type booleanchargetCharProperty(String name) Get a property of type chargetDateProperty(String name) Get a property of type java.util.DatedoublegetDoubleProperty(String name) Get a property of type doublefloatgetFloatProperty(String name) Get a property of type floatintgetIntProperty(String name) Get a property of type intlonggetLongProperty(String name) Get a property of type longgetStringProperty(String name) Get a property of type String
-
Field Details
-
PROP_EXCHANGE_FOLDER
- See Also:
-
PROP_LOGGING_LEVEL
- See Also:
-
PROP_TRANSPORT_AUTHENTICATION
- See Also:
-
PROP_TRANSPORT_SECRET
- See Also:
-
PROP_REPOSITORY_FOLDER
- See Also:
-
-
Constructor Details
-
PropertyService
public PropertyService()Constructor -
PropertyService
Constructor- Parameters:
pathToFile-
-
-
Method Details
-
getStringProperty
Get a property of type String- Parameters:
name- the property name- Returns:
- the property value
- Throws:
IllegalPropertyValueException- if the property doesn't exist
-
getIntProperty
Get a property of type int- Parameters:
name- the property name- Returns:
- the property value
- Throws:
IllegalPropertyValueException- if the property value doesn't represent an integer
-
getLongProperty
Get a property of type long- Parameters:
name- the property name- Returns:
- the property value
- Throws:
IllegalPropertyValueException- if the property value doesn't represent a long
-
getDoubleProperty
Get a property of type double- Parameters:
name- the property name- Returns:
- the property value
- Throws:
IllegalPropertyValueException- if the property value doesn't represent a double
-
getFloatProperty
Get a property of type float- Parameters:
name- the property name- Returns:
- the property value
- Throws:
IllegalPropertyValueException- if the property value doesn't represent a float
-
getCharProperty
Get a property of type char- Parameters:
name- the property name- Returns:
- the property value
- Throws:
IllegalPropertyValueException- if the property value doesn't represent a character
-
getDateProperty
Get a property of type java.util.Date- Parameters:
name- the property name- Returns:
- the property value
- Throws:
IllegalPropertyValueException- if the property value doesn't represent a date
-
getBooleanProperty
Get a property of type boolean- Parameters:
name- the property name- Returns:
- the property value
- Throws:
IllegalPropertyValueException- if the property value doesn't represent a boolean
-