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