Class PropertyService
- java.lang.Object
-
- net.sourceforge.jbizmo.commons.property.PropertyService
-
public class PropertyService extends Object
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 Modifier and Type Field Description static StringPROP_EXCHANGE_FOLDERstatic StringPROP_LOGGING_LEVELstatic StringPROP_PERFORM_LOGINstatic StringPROP_REPOSITORY_FOLDER
-
Constructor Summary
Constructors Constructor Description PropertyService()ConstructorPropertyService(String pathToFile)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetBooleanProperty(String name)Get a property of type booleanchargetCharProperty(String name)Get a property of type charDategetDateProperty(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 longStringgetStringProperty(String name)Get a property of type String
-
-
-
Field Detail
-
PROP_EXCHANGE_FOLDER
public static final String PROP_EXCHANGE_FOLDER
- See Also:
- Constant Field Values
-
PROP_LOGGING_LEVEL
public static final String PROP_LOGGING_LEVEL
- See Also:
- Constant Field Values
-
PROP_PERFORM_LOGIN
public static final String PROP_PERFORM_LOGIN
- See Also:
- Constant Field Values
-
PROP_REPOSITORY_FOLDER
public static final String PROP_REPOSITORY_FOLDER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PropertyService
public PropertyService()
Constructor
-
PropertyService
public PropertyService(String pathToFile)
Constructor- Parameters:
pathToFile-
-
-
Method Detail
-
getStringProperty
public String getStringProperty(String name)
Get a property of type String- Parameters:
name- the property name- Returns:
- the property value
- Throws:
IllegalPropertyValueException- if the property doesn't exist
-
getIntProperty
public int getIntProperty(String name)
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
public long getLongProperty(String name)
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
public double getDoubleProperty(String name)
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
public float getFloatProperty(String name)
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
public char getCharProperty(String name)
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
public Date getDateProperty(String name)
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
public boolean getBooleanProperty(String name)
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
-
-