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
| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_EXCHANGE_FOLDER |
static String |
PROP_LOGGING_LEVEL |
static String |
PROP_REPOSITORY_FOLDER |
| Constructor and Description |
|---|
PropertyService()
Constructor
|
PropertyService(String pathToFile)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBooleanProperty(String name)
Get property
|
char |
getCharProperty(String name)
Get property
|
Date |
getDateProperty(String name)
Get property
|
double |
getDoubleProperty(String name)
Get property
|
float |
getFloatProperty(String name)
Get property
|
int |
getIntProperty(String name)
Get property
|
long |
getLongProperty(String name)
Get property
|
String |
getStringProperty(String name)
Get property
|
public static final String PROP_LOGGING_LEVEL
public static final String PROP_EXCHANGE_FOLDER
public static final String PROP_REPOSITORY_FOLDER
public PropertyService()
public PropertyService(String pathToFile)
pathToFile - public String getStringProperty(String name)
name - the property nameIllegalPropertyValueException - if the property doesn't existpublic int getIntProperty(String name)
name - the property nameIllegalPropertyValueException - if the property value doesn't represent an integerpublic long getLongProperty(String name)
name - the property nameIllegalPropertyValueException - if the property value doesn't represent a longpublic double getDoubleProperty(String name)
name - the property nameIllegalPropertyValueException - if the property value doesn't represent a doublepublic float getFloatProperty(String name)
name - the property nameIllegalPropertyValueException - if the property value doesn't represent a floatpublic char getCharProperty(String name)
name - the property nameIllegalPropertyValueException - if the property value doesn't represent a characterpublic Date getDateProperty(String name)
name - the property nameIllegalPropertyValueException - if the property value doesn't represent a datepublic boolean getBooleanProperty(String name)
name - the property nameIllegalPropertyValueException - if the property value doesn't represent a booleanCopyright © 2018. All rights reserved.