org.apache.commons.configuration

Class DataConfiguration

public class DataConfiguration extends AbstractConfiguration implements Serializable

Decorator providing additional getters for any Configuration. This extended Configuration supports more types: URL, Locale, Date, Calendar, Color, as well as lists and arrays for all types.

Let us know if you find this useful, the most frequently used getters are likely to be integrated in the Configuration interface in a future version.

Since: 1.1

Version: $Revision: 439648 $, $Date: 2006-09-02 22:42:10 +0200 (Sa, 02 Sep 2006) $

Author: Emmanuel Bourg

Field Summary
protected Configurationconfiguration
Stores the wrapped configuration.
static StringDATE_FORMAT_KEY
The key of the property storing the user defined date format.
static StringDEFAULT_DATE_FORMAT
The default format for dates.
static longserialVersionUID
The serial version UID.
Constructor Summary
DataConfiguration(Configuration configuration)
Creates a new instance of DataConfiguration and sets the wrapped configuration.
Method Summary
protected voidaddPropertyDirect(String key, Object obj)
voidclearProperty(String key)
booleancontainsKey(String key)
BigDecimal[]getBigDecimalArray(String key)
Get an array of BigDecimals associated with the given configuration key.
BigDecimal[]getBigDecimalArray(String key, BigDecimal[] defaultValue)
Get an array of BigDecimals associated with the given configuration key.
ListgetBigDecimalList(String key)
Get a list of BigDecimals associated with the given configuration key.
ListgetBigDecimalList(String key, List defaultValue)
Get a list of BigDecimals associated with the given configuration key.
BigInteger[]getBigIntegerArray(String key)
Get an array of BigIntegers associated with the given configuration key.
BigInteger[]getBigIntegerArray(String key, BigInteger[] defaultValue)
Get an array of BigIntegers associated with the given configuration key.
ListgetBigIntegerList(String key)
Get a list of BigIntegers associated with the given configuration key.
ListgetBigIntegerList(String key, List defaultValue)
Get a list of BigIntegers associated with the given configuration key.
boolean[]getBooleanArray(String key)
Get an array of boolean primitives associated with the given configuration key.
boolean[]getBooleanArray(String key, boolean[] defaultValue)
Get an array of boolean primitives associated with the given configuration key.
ListgetBooleanList(String key)
Get a list of Boolean objects associated with the given configuration key.
ListgetBooleanList(String key, List defaultValue)
Get a list of Boolean objects associated with the given configuration key.
byte[]getByteArray(String key)
Get an array of byte primitives associated with the given configuration key.
byte[]getByteArray(String key, byte[] defaultValue)
Get an array of byte primitives associated with the given configuration key.
ListgetByteList(String key)
Get a list of Byte objects associated with the given configuration key.
ListgetByteList(String key, List defaultValue)
Get a list of Byte objects associated with the given configuration key.
CalendargetCalendar(String key)
Get a Calendar associated with the given configuration key.
CalendargetCalendar(String key, String format)
Get a Calendar associated with the given configuration key.
CalendargetCalendar(String key, Calendar defaultValue)
Get a Calendar associated with the given configuration key.
CalendargetCalendar(String key, Calendar defaultValue, String format)
Get a Calendar associated with the given configuration key.
Calendar[]getCalendarArray(String key)
Get an array of Calendars associated with the given configuration key.
Calendar[]getCalendarArray(String key, String format)
Get an array of Calendars associated with the given configuration key.
Calendar[]getCalendarArray(String key, Calendar[] defaultValue)
Get an array of Calendars associated with the given configuration key.
Calendar[]getCalendarArray(String key, Calendar[] defaultValue, String format)
Get an array of Calendars associated with the given configuration key.
ListgetCalendarList(String key)
Get a list of Calendars associated with the given configuration key.
ListgetCalendarList(String key, String format)
Get a list of Calendars associated with the given configuration key.
ListgetCalendarList(String key, List defaultValue)
Get a list of Calendars associated with the given configuration key.
ListgetCalendarList(String key, List defaultValue, String format)
Get a list of Calendars associated with the given configuration key.
ColorgetColor(String key)
Get a Color associated with the given configuration key.
ColorgetColor(String key, Color defaultValue)
Get a Color associated with the given configuration key.
Color[]getColorArray(String key)
Get an array of Colors associated with the given configuration key.
Color[]getColorArray(String key, Color[] defaultValue)
Get an array of Colors associated with the given configuration key.
ListgetColorList(String key)
Get a list of Colors associated with the given configuration key.
ListgetColorList(String key, List defaultValue)
Get a list of Colors associated with the given configuration key.
ConfigurationgetConfiguration()
Return the configuration decorated by this DataConfiguration.
DategetDate(String key)
Get a Date associated with the given configuration key.
DategetDate(String key, String format)
Get a Date associated with the given configuration key.
DategetDate(String key, Date defaultValue)
Get a Date associated with the given configuration key.
DategetDate(String key, Date defaultValue, String format)
Get a Date associated with the given configuration key.
Date[]getDateArray(String key)
Get an array of Dates associated with the given configuration key.
Date[]getDateArray(String key, String format)
Get an array of Dates associated with the given configuration key.
Date[]getDateArray(String key, Date[] defaultValue)
Get an array of Dates associated with the given configuration key.
Date[]getDateArray(String key, Date[] defaultValue, String format)
Get an array of Dates associated with the given configuration key.
ListgetDateList(String key)
Get a list of Dates associated with the given configuration key.
ListgetDateList(String key, String format)
Get a list of Dates associated with the given configuration key.
ListgetDateList(String key, List defaultValue)
Get a list of Dates associated with the given configuration key.
ListgetDateList(String key, List defaultValue, String format)
Get a list of Dates associated with the given configuration key.
StringgetDefaultDateFormat()
Returns the date format specified by the user in the DATE_FORMAT_KEY property, or the default format otherwise.
double[]getDoubleArray(String key)
Get an array of double primitives associated with the given configuration key.
double[]getDoubleArray(String key, double[] defaultValue)
Get an array of double primitives associated with the given configuration key.
ListgetDoubleList(String key)
Get a list of Double objects associated with the given configuration key.
ListgetDoubleList(String key, List defaultValue)
Get a list of Double objects associated with the given configuration key.
float[]getFloatArray(String key)
Get an array of float primitives associated with the given configuration key.
float[]getFloatArray(String key, float[] defaultValue)
Get an array of float primitives associated with the given configuration key.
ListgetFloatList(String key)
Get a list of Float objects associated with the given configuration key.
ListgetFloatList(String key, List defaultValue)
Get a list of Float objects associated with the given configuration key.
int[]getIntArray(String key)
Get an array of int primitives associated with the given configuration key.
int[]getIntArray(String key, int[] defaultValue)
Get an array of int primitives associated with the given configuration key.
ListgetIntegerList(String key)
Get a list of Integer objects associated with the given configuration key.
ListgetIntegerList(String key, List defaultValue)
Get a list of Integer objects associated with the given configuration key.
IteratorgetKeys()
LocalegetLocale(String key)
Get a Locale associated with the given configuration key.
LocalegetLocale(String key, Locale defaultValue)
Get a Locale associated with the given configuration key.
Locale[]getLocaleArray(String key)
Get an array of Locales associated with the given configuration key.
Locale[]getLocaleArray(String key, Locale[] defaultValue)
Get an array of Locales associated with the given configuration key.
ListgetLocaleList(String key)
Get a list of Locales associated with the given configuration key.
ListgetLocaleList(String key, List defaultValue)
Get a list of Locales associated with the given configuration key.
long[]getLongArray(String key)
Get an array of long primitives associated with the given configuration key.
long[]getLongArray(String key, long[] defaultValue)
Get an array of long primitives associated with the given configuration key.
ListgetLongList(String key)
Get a list of Long objects associated with the given configuration key.
ListgetLongList(String key, List defaultValue)
Get a list of Long objects associated with the given configuration key.
ObjectgetProperty(String key)
short[]getShortArray(String key)
Get an array of short primitives associated with the given configuration key.
short[]getShortArray(String key, short[] defaultValue)
Get an array of short primitives associated with the given configuration key.
ListgetShortList(String key)
Get a list of Short objects associated with the given configuration key.
ListgetShortList(String key, List defaultValue)
Get a list of Short objects associated with the given configuration key.
URLgetURL(String key)
Get an URL associated with the given configuration key.
URLgetURL(String key, URL defaultValue)
Get an URL associated with the given configuration key.
URL[]getURLArray(String key)
Get an array of URLs associated with the given configuration key.
URL[]getURLArray(String key, URL[] defaultValue)
Get an array of URLs associated with the given configuration key.
ListgetURLList(String key)
Get a list of URLs associated with the given configuration key.
ListgetURLList(String key, List defaultValue)
Get a list of URLs associated with the given configuration key.
booleanisEmpty()

Field Detail

configuration

protected Configuration configuration
Stores the wrapped configuration.

DATE_FORMAT_KEY

public static final String DATE_FORMAT_KEY
The key of the property storing the user defined date format.

DEFAULT_DATE_FORMAT

public static final String DEFAULT_DATE_FORMAT
The default format for dates.

serialVersionUID

private static final long serialVersionUID
The serial version UID.

Constructor Detail

DataConfiguration

public DataConfiguration(Configuration configuration)
Creates a new instance of DataConfiguration and sets the wrapped configuration.

Parameters: configuration the wrapped configuration

Method Detail

addPropertyDirect

protected void addPropertyDirect(String key, Object obj)

clearProperty

public void clearProperty(String key)

containsKey

public boolean containsKey(String key)

getBigDecimalArray

public BigDecimal[] getBigDecimalArray(String key)
Get an array of BigDecimals associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated BigDecimal array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of BigDecimals.

getBigDecimalArray

public BigDecimal[] getBigDecimalArray(String key, BigDecimal[] defaultValue)
Get an array of BigDecimals associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated BigDecimal array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of BigDecimals.

getBigDecimalList

public List getBigDecimalList(String key)
Get a list of BigDecimals associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated BigDecimal list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of BigDecimals.

getBigDecimalList

public List getBigDecimalList(String key, List defaultValue)
Get a list of BigDecimals associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of BigDecimals.

Throws: ConversionException is thrown if the key maps to an object that is not a list of BigDecimals.

getBigIntegerArray

public BigInteger[] getBigIntegerArray(String key)
Get an array of BigIntegers associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated BigInteger array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of BigIntegers.

getBigIntegerArray

public BigInteger[] getBigIntegerArray(String key, BigInteger[] defaultValue)
Get an array of BigIntegers associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated BigInteger array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of BigIntegers.

getBigIntegerList

public List getBigIntegerList(String key)
Get a list of BigIntegers associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated BigInteger list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of BigIntegers.

getBigIntegerList

public List getBigIntegerList(String key, List defaultValue)
Get a list of BigIntegers associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of BigIntegers.

Throws: ConversionException is thrown if the key maps to an object that is not a list of BigIntegers.

getBooleanArray

public boolean[] getBooleanArray(String key)
Get an array of boolean primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated boolean array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of booleans.

getBooleanArray

public boolean[] getBooleanArray(String key, boolean[] defaultValue)
Get an array of boolean primitives associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated boolean array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of booleans.

getBooleanList

public List getBooleanList(String key)
Get a list of Boolean objects associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated Boolean list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of booleans.

getBooleanList

public List getBooleanList(String key, List defaultValue)
Get a list of Boolean objects associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of strings.

Throws: ConversionException is thrown if the key maps to an object that is not a list of booleans.

getByteArray

public byte[] getByteArray(String key)
Get an array of byte primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated byte array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of bytes.

getByteArray

public byte[] getByteArray(String key, byte[] defaultValue)
Get an array of byte primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated byte array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of bytes.

getByteList

public List getByteList(String key)
Get a list of Byte objects associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated Byte list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of bytes.

getByteList

public List getByteList(String key, List defaultValue)
Get a list of Byte objects associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of Bytes.

Throws: ConversionException is thrown if the key maps to an object that is not a list of bytes.

getCalendar

public Calendar getCalendar(String key)
Get a Calendar associated with the given configuration key. If the property is a String, it will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern.

Parameters: key The configuration key.

Returns: The associated Calendar.

Throws: ConversionException is thrown if the key maps to an object that is not a Calendar.

getCalendar

public Calendar getCalendar(String key, String format)
Get a Calendar associated with the given configuration key. If the property is a String, it will be parsed with the specified format pattern.

Parameters: key The configuration key. format The non-localized java.text.DateFormat pattern.

Returns: The associated Calendar

Throws: ConversionException is thrown if the key maps to an object that is not a Calendar.

getCalendar

public Calendar getCalendar(String key, Calendar defaultValue)
Get a Calendar associated with the given configuration key. If the property is a String, it will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated Calendar.

Throws: ConversionException is thrown if the key maps to an object that is not a Calendar.

getCalendar

public Calendar getCalendar(String key, Calendar defaultValue, String format)
Get a Calendar associated with the given configuration key. If the property is a String, it will be parsed with the specified format pattern. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value. format The non-localized java.text.DateFormat pattern.

Returns: The associated Calendar.

Throws: ConversionException is thrown if the key maps to an object that is not a Calendar.

getCalendarArray

public Calendar[] getCalendarArray(String key)
Get an array of Calendars associated with the given configuration key. If the property is a list of Strings, they will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated Calendar array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Calendars.

getCalendarArray

public Calendar[] getCalendarArray(String key, String format)
Get an array of Calendars associated with the given configuration key. If the property is a list of Strings, they will be parsed with the specified format pattern. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. format The non-localized java.text.DateFormat pattern.

Returns: The associated Calendar array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Calendars.

getCalendarArray

public Calendar[] getCalendarArray(String key, Calendar[] defaultValue)
Get an array of Calendars associated with the given configuration key. If the property is a list of Strings, they will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated Calendar array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Calendars.

getCalendarArray

public Calendar[] getCalendarArray(String key, Calendar[] defaultValue, String format)
Get an array of Calendars associated with the given configuration key. If the property is a list of Strings, they will be parsed with the specified format pattern. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value. format The non-localized java.text.DateFormat pattern.

Returns: The associated Calendar array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Calendars.

getCalendarList

public List getCalendarList(String key)
Get a list of Calendars associated with the given configuration key. If the property is a list of Strings, they will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated Calendar list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Calendars.

getCalendarList

public List getCalendarList(String key, String format)
Get a list of Calendars associated with the given configuration key. If the property is a list of Strings, they will be parsed with the specified format pattern. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key. format The non-localized java.text.DateFormat pattern.

Returns: The associated Calendar list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Calendars.

getCalendarList

public List getCalendarList(String key, List defaultValue)
Get a list of Calendars associated with the given configuration key. If the property is a list of Strings, they will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated Calendar list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Calendars.

getCalendarList

public List getCalendarList(String key, List defaultValue, String format)
Get a list of Calendars associated with the given configuration key. If the property is a list of Strings, they will be parsed with the specified format pattern. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value. format The non-localized java.text.DateFormat pattern.

Returns: The associated Calendar list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Calendars.

getColor

public Color getColor(String key)
Get a Color associated with the given configuration key.

Parameters: key The configuration key.

Returns: The associated Color.

Throws: ConversionException is thrown if the key maps to an object that is not a Color.

getColor

public Color getColor(String key, Color defaultValue)
Get a Color associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated Color.

Throws: ConversionException is thrown if the key maps to an object that is not a Color.

getColorArray

public Color[] getColorArray(String key)
Get an array of Colors associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated Color array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Colors.

getColorArray

public Color[] getColorArray(String key, Color[] defaultValue)
Get an array of Colors associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated Color array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Colors.

getColorList

public List getColorList(String key)
Get a list of Colors associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated Color list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Colors.

getColorList

public List getColorList(String key, List defaultValue)
Get a list of Colors associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of Colors.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Colors.

getConfiguration

public Configuration getConfiguration()
Return the configuration decorated by this DataConfiguration.

Returns: the wrapped configuration

getDate

public Date getDate(String key)
Get a Date associated with the given configuration key. If the property is a String, it will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern.

Parameters: key The configuration key.

Returns: The associated Date.

Throws: ConversionException is thrown if the key maps to an object that is not a Date.

getDate

public Date getDate(String key, String format)
Get a Date associated with the given configuration key. If the property is a String, it will be parsed with the specified format pattern.

Parameters: key The configuration key. format The non-localized java.text.DateFormat pattern.

Returns: The associated Date

Throws: ConversionException is thrown if the key maps to an object that is not a Date.

getDate

public Date getDate(String key, Date defaultValue)
Get a Date associated with the given configuration key. If the property is a String, it will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated Date.

Throws: ConversionException is thrown if the key maps to an object that is not a Date.

getDate

public Date getDate(String key, Date defaultValue, String format)
Get a Date associated with the given configuration key. If the property is a String, it will be parsed with the specified format pattern. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value. format The non-localized java.text.DateFormat pattern.

Returns: The associated Date.

Throws: ConversionException is thrown if the key maps to an object that is not a Date.

getDateArray

public Date[] getDateArray(String key)
Get an array of Dates associated with the given configuration key. If the property is a list of Strings, they will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated Date array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Dates.

getDateArray

public Date[] getDateArray(String key, String format)
Get an array of Dates associated with the given configuration key. If the property is a list of Strings, they will be parsed with the specified format pattern. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. format The non-localized java.text.DateFormat pattern.

Returns: The associated Date array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Dates.

getDateArray

public Date[] getDateArray(String key, Date[] defaultValue)
Get an array of Dates associated with the given configuration key. If the property is a list of Strings, they will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated Date array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Dates.

getDateArray

public Date[] getDateArray(String key, Date[] defaultValue, String format)
Get an array of Dates associated with the given configuration key. If the property is a list of Strings, they will be parsed with the specified format pattern. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value. format The non-localized java.text.DateFormat pattern.

Returns: The associated Date array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Dates.

getDateList

public List getDateList(String key)
Get a list of Dates associated with the given configuration key. If the property is a list of Strings, they will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated Date list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Dates.

getDateList

public List getDateList(String key, String format)
Get a list of Dates associated with the given configuration key. If the property is a list of Strings, they will be parsed with the specified format pattern. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key. format The non-localized java.text.DateFormat pattern.

Returns: The associated Date list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Dates.

getDateList

public List getDateList(String key, List defaultValue)
Get a list of Dates associated with the given configuration key. If the property is a list of Strings, they will be parsed with the format defined by the user in the DATE_FORMAT_KEY property, or if it's not defined with the DEFAULT_DATE_FORMAT pattern. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated Date list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Dates.

getDateList

public List getDateList(String key, List defaultValue, String format)
Get a list of Dates associated with the given configuration key. If the property is a list of Strings, they will be parsed with the specified format pattern. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value. format The non-localized java.text.DateFormat pattern.

Returns: The associated Date list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Dates.

getDefaultDateFormat

private String getDefaultDateFormat()
Returns the date format specified by the user in the DATE_FORMAT_KEY property, or the default format otherwise.

Returns: the default date format

getDoubleArray

public double[] getDoubleArray(String key)
Get an array of double primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated double array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of doubles.

getDoubleArray

public double[] getDoubleArray(String key, double[] defaultValue)
Get an array of double primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated double array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of doubles.

getDoubleList

public List getDoubleList(String key)
Get a list of Double objects associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated Double list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of doubles.

getDoubleList

public List getDoubleList(String key, List defaultValue)
Get a list of Double objects associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of Doubles.

Throws: ConversionException is thrown if the key maps to an object that is not a list of doubles.

getFloatArray

public float[] getFloatArray(String key)
Get an array of float primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated float array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of floats.

getFloatArray

public float[] getFloatArray(String key, float[] defaultValue)
Get an array of float primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated float array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of floats.

getFloatList

public List getFloatList(String key)
Get a list of Float objects associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated Float list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of floats.

getFloatList

public List getFloatList(String key, List defaultValue)
Get a list of Float objects associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of Floats.

Throws: ConversionException is thrown if the key maps to an object that is not a list of floats.

getIntArray

public int[] getIntArray(String key)
Get an array of int primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated int array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of integers.

getIntArray

public int[] getIntArray(String key, int[] defaultValue)
Get an array of int primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated int array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of integers.

getIntegerList

public List getIntegerList(String key)
Get a list of Integer objects associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated Integer list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of integers.

getIntegerList

public List getIntegerList(String key, List defaultValue)
Get a list of Integer objects associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of Integers.

Throws: ConversionException is thrown if the key maps to an object that is not a list of integers.

getKeys

public Iterator getKeys()

getLocale

public Locale getLocale(String key)
Get a Locale associated with the given configuration key.

Parameters: key The configuration key.

Returns: The associated Locale.

Throws: ConversionException is thrown if the key maps to an object that is not a Locale.

getLocale

public Locale getLocale(String key, Locale defaultValue)
Get a Locale associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated Locale.

Throws: ConversionException is thrown if the key maps to an object that is not a Locale.

getLocaleArray

public Locale[] getLocaleArray(String key)
Get an array of Locales associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated Locale array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Locales.

getLocaleArray

public Locale[] getLocaleArray(String key, Locale[] defaultValue)
Get an array of Locales associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated Locale array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Locales.

getLocaleList

public List getLocaleList(String key)
Get a list of Locales associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated Locale list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Locales.

getLocaleList

public List getLocaleList(String key, List defaultValue)
Get a list of Locales associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of Locales.

Throws: ConversionException is thrown if the key maps to an object that is not a list of Locales.

getLongArray

public long[] getLongArray(String key)
Get an array of long primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated long array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of longs.

getLongArray

public long[] getLongArray(String key, long[] defaultValue)
Get an array of long primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated long array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of longs.

getLongList

public List getLongList(String key)
Get a list of Long objects associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated Long list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of longs.

getLongList

public List getLongList(String key, List defaultValue)
Get a list of Long objects associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of Longs.

Throws: ConversionException is thrown if the key maps to an object that is not a list of longs.

getProperty

public Object getProperty(String key)

getShortArray

public short[] getShortArray(String key)
Get an array of short primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated short array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of shorts.

getShortArray

public short[] getShortArray(String key, short[] defaultValue)
Get an array of short primitives associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated short array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of shorts.

getShortList

public List getShortList(String key)
Get a list of Short objects associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated Short list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of shorts.

getShortList

public List getShortList(String key, List defaultValue)
Get a list of Short objects associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of Shorts.

Throws: ConversionException is thrown if the key maps to an object that is not a list of shorts.

getURL

public URL getURL(String key)
Get an URL associated with the given configuration key.

Parameters: key The configuration key.

Returns: The associated URL.

Throws: ConversionException is thrown if the key maps to an object that is not an URL.

getURL

public URL getURL(String key, URL defaultValue)
Get an URL associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated URL.

Throws: ConversionException is thrown if the key maps to an object that is not an URL.

getURLArray

public URL[] getURLArray(String key)
Get an array of URLs associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key.

Returns: The associated URL array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of URLs.

getURLArray

public URL[] getURLArray(String key, URL[] defaultValue)
Get an array of URLs associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned.

Parameters: key The configuration key. defaultValue the default value, which will be returned if the property is not found

Returns: The associated URL array if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of URLs.

getURLList

public List getURLList(String key)
Get a list of URLs associated with the given configuration key. If the key doesn't map to an existing object an empty list is returned.

Parameters: key The configuration key.

Returns: The associated URL list if the key is found.

Throws: ConversionException is thrown if the key maps to an object that is not a list of URLs.

getURLList

public List getURLList(String key, List defaultValue)
Get a list of URLs associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.

Parameters: key The configuration key. defaultValue The default value.

Returns: The associated List of URLs.

Throws: ConversionException is thrown if the key maps to an object that is not a list of URLs.

isEmpty

public boolean isEmpty()