Package org.apache.commons.configuration
Class DataConfiguration
- java.lang.Object
-
- org.apache.commons.configuration.event.EventSource
-
- org.apache.commons.configuration.AbstractConfiguration
-
- org.apache.commons.configuration.DataConfiguration
-
- All Implemented Interfaces:
java.io.Serializable
,Configuration
public class DataConfiguration extends AbstractConfiguration implements java.io.Serializable
Decorator providing additional getters for any Configuration. This extended Configuration supports more types:URL
Locale
Date
Calendar
Color
InetAddress
javax.mail.internet.InternetAddress
(requires Javamail in the classpath)Enum
(Java 5 enumeration types)
Example
Configuration file config.properties:title.color = #0000FF remote.host = 192.168.0.53 default.locales = fr,en,de email.contact = ebourg@apache.org, oheger@apache.org
Usage:DataConfiguration config = new DataConfiguration(new PropertiesConfiguration("config.properties")); // retrieve a property using a specialized getter Color color = config.getColor("title.color"); // retrieve a property using a generic getter InetAddress host = (InetAddress) config.get(InetAddress.class, "remote.host"); Locale[] locales = (Locale[]) config.getArray(Locale.class, "default.locales"); List contacts = config.getList(InternetAddress.class, "email.contact");
Dates
Date objects are expected to be formatted with the pattern yyyy-MM-dd HH:mm:ss. This default format can be changed by specifying another format in the getters, or by putting a date format in the configuration under the key org.apache.commons.configuration.format.date.- Since:
- 1.1
- Version:
- $Id: DataConfiguration.java 1234985 2012-01-23 21:09:09Z oheger $
- Author:
- Emmanuel Bourg
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Configuration
configuration
Stores the wrapped configuration.static java.lang.String
DATE_FORMAT_KEY
The key of the property storing the user defined date format.static java.lang.String
DEFAULT_DATE_FORMAT
The default format for dates.-
Fields inherited from class org.apache.commons.configuration.AbstractConfiguration
END_TOKEN, EVENT_ADD_PROPERTY, EVENT_CLEAR, EVENT_CLEAR_PROPERTY, EVENT_READ_PROPERTY, EVENT_SET_PROPERTY, START_TOKEN
-
-
Constructor Summary
Constructors Constructor Description DataConfiguration(Configuration configuration)
Creates a new instance ofDataConfiguration
and sets the wrapped configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProperty(java.lang.String key, java.lang.Object value)
Add a property to the configuration.protected void
addPropertyDirect(java.lang.String key, java.lang.Object obj)
Adds a key/value pair to the Configuration.void
clearProperty(java.lang.String key)
Removes the specified property from this configuration.boolean
containsKey(java.lang.String key)
Check if the configuration contains the specified key.<T> T
get(java.lang.Class<T> cls, java.lang.String key)
Get an object of the specified type associated with the given configuration key.<T> T
get(java.lang.Class<T> cls, java.lang.String key, T defaultValue)
Get an object of the specified type associated with the given configuration key.java.lang.Object
getArray(java.lang.Class<?> cls, java.lang.String key)
Get an array of typed objects associated with the given configuration key.java.lang.Object
getArray(java.lang.Class<?> cls, java.lang.String key, java.lang.Object defaultValue)
Get an array of typed objects associated with the given configuration key.java.math.BigDecimal[]
getBigDecimalArray(java.lang.String key)
Get an array of BigDecimals associated with the given configuration key.java.math.BigDecimal[]
getBigDecimalArray(java.lang.String key, java.math.BigDecimal[] defaultValue)
Get an array of BigDecimals associated with the given configuration key.java.util.List<java.math.BigDecimal>
getBigDecimalList(java.lang.String key)
Get a list of BigDecimals associated with the given configuration key.java.util.List<java.math.BigDecimal>
getBigDecimalList(java.lang.String key, java.util.List<java.math.BigDecimal> defaultValue)
Get a list of BigDecimals associated with the given configuration key.java.math.BigInteger[]
getBigIntegerArray(java.lang.String key)
Get an array of BigIntegers associated with the given configuration key.java.math.BigInteger[]
getBigIntegerArray(java.lang.String key, java.math.BigInteger[] defaultValue)
Get an array of BigIntegers associated with the given configuration key.java.util.List<java.math.BigInteger>
getBigIntegerList(java.lang.String key)
Get a list of BigIntegers associated with the given configuration key.java.util.List<java.math.BigInteger>
getBigIntegerList(java.lang.String key, java.util.List<java.math.BigInteger> defaultValue)
Get a list of BigIntegers associated with the given configuration key.boolean[]
getBooleanArray(java.lang.String key)
Get an array of boolean primitives associated with the given configuration key.boolean[]
getBooleanArray(java.lang.String key, boolean[] defaultValue)
Get an array of boolean primitives associated with the given configuration key.java.util.List<java.lang.Boolean>
getBooleanList(java.lang.String key)
Get a list of Boolean objects associated with the given configuration key.java.util.List<java.lang.Boolean>
getBooleanList(java.lang.String key, java.util.List<java.lang.Boolean> defaultValue)
Get a list of Boolean objects associated with the given configuration key.byte[]
getByteArray(java.lang.String key)
Get an array of byte primitives associated with the given configuration key.byte[]
getByteArray(java.lang.String key, byte[] defaultValue)
Get an array of byte primitives associated with the given configuration key.java.util.List<java.lang.Byte>
getByteList(java.lang.String key)
Get a list of Byte objects associated with the given configuration key.java.util.List<java.lang.Byte>
getByteList(java.lang.String key, java.util.List<java.lang.Byte> defaultValue)
Get a list of Byte objects associated with the given configuration key.java.util.Calendar
getCalendar(java.lang.String key)
Get a Calendar associated with the given configuration key.java.util.Calendar
getCalendar(java.lang.String key, java.lang.String format)
Get a Calendar associated with the given configuration key.java.util.Calendar
getCalendar(java.lang.String key, java.util.Calendar defaultValue)
Get a Calendar associated with the given configuration key.java.util.Calendar
getCalendar(java.lang.String key, java.util.Calendar defaultValue, java.lang.String format)
Get a Calendar associated with the given configuration key.java.util.Calendar[]
getCalendarArray(java.lang.String key)
Get an array of Calendars associated with the given configuration key.java.util.Calendar[]
getCalendarArray(java.lang.String key, java.lang.String format)
Get an array of Calendars associated with the given configuration key.java.util.Calendar[]
getCalendarArray(java.lang.String key, java.util.Calendar[] defaultValue)
Get an array of Calendars associated with the given configuration key.java.util.Calendar[]
getCalendarArray(java.lang.String key, java.util.Calendar[] defaultValue, java.lang.String format)
Get an array of Calendars associated with the given configuration key.java.util.List<java.util.Calendar>
getCalendarList(java.lang.String key)
Get a list of Calendars associated with the given configuration key.java.util.List<java.util.Calendar>
getCalendarList(java.lang.String key, java.lang.String format)
Get a list of Calendars associated with the given configuration key.java.util.List<java.util.Calendar>
getCalendarList(java.lang.String key, java.util.List<java.util.Calendar> defaultValue)
Get a list of Calendars associated with the given configuration key.java.util.List<java.util.Calendar>
getCalendarList(java.lang.String key, java.util.List<java.util.Calendar> defaultValue, java.lang.String format)
Get a list of Calendars associated with the given configuration key.java.awt.Color
getColor(java.lang.String key)
Get a Color associated with the given configuration key.java.awt.Color
getColor(java.lang.String key, java.awt.Color defaultValue)
Get a Color associated with the given configuration key.java.awt.Color[]
getColorArray(java.lang.String key)
Get an array of Colors associated with the given configuration key.java.awt.Color[]
getColorArray(java.lang.String key, java.awt.Color[] defaultValue)
Get an array of Colors associated with the given configuration key.java.util.List<java.awt.Color>
getColorList(java.lang.String key)
Get a list of Colors associated with the given configuration key.java.util.List<java.awt.Color>
getColorList(java.lang.String key, java.util.List<java.awt.Color> defaultValue)
Get a list of Colors associated with the given configuration key.Configuration
getConfiguration()
Return the configuration decorated by this DataConfiguration.java.util.Date
getDate(java.lang.String key)
Get a Date associated with the given configuration key.java.util.Date
getDate(java.lang.String key, java.lang.String format)
Get a Date associated with the given configuration key.java.util.Date
getDate(java.lang.String key, java.util.Date defaultValue)
Get a Date associated with the given configuration key.java.util.Date
getDate(java.lang.String key, java.util.Date defaultValue, java.lang.String format)
Get a Date associated with the given configuration key.java.util.Date[]
getDateArray(java.lang.String key)
Get an array of Dates associated with the given configuration key.java.util.Date[]
getDateArray(java.lang.String key, java.lang.String format)
Get an array of Dates associated with the given configuration key.java.util.Date[]
getDateArray(java.lang.String key, java.util.Date[] defaultValue)
Get an array of Dates associated with the given configuration key.java.util.Date[]
getDateArray(java.lang.String key, java.util.Date[] defaultValue, java.lang.String format)
Get an array of Dates associated with the given configuration key.java.util.List<java.util.Date>
getDateList(java.lang.String key)
java.util.List<java.util.Date>
getDateList(java.lang.String key, java.lang.String format)
Get a list of Dates associated with the given configuration key.java.util.List<java.util.Date>
getDateList(java.lang.String key, java.util.List<java.util.Date> defaultValue)
Get a list of Dates associated with the given configuration key.java.util.List<java.util.Date>
getDateList(java.lang.String key, java.util.List<java.util.Date> defaultValue, java.lang.String format)
Get a list of Dates associated with the given configuration key.double[]
getDoubleArray(java.lang.String key)
Get an array of double primitives associated with the given configuration key.double[]
getDoubleArray(java.lang.String key, double[] defaultValue)
Get an array of double primitives associated with the given configuration key.java.util.List<java.lang.Double>
getDoubleList(java.lang.String key)
Get a list of Double objects associated with the given configuration key.java.util.List<java.lang.Double>
getDoubleList(java.lang.String key, java.util.List<java.lang.Double> defaultValue)
Get a list of Double objects associated with the given configuration key.float[]
getFloatArray(java.lang.String key)
Get an array of float primitives associated with the given configuration key.float[]
getFloatArray(java.lang.String key, float[] defaultValue)
Get an array of float primitives associated with the given configuration key.java.util.List<java.lang.Float>
getFloatList(java.lang.String key)
Get a list of Float objects associated with the given configuration key.java.util.List<java.lang.Float>
getFloatList(java.lang.String key, java.util.List<java.lang.Float> defaultValue)
Get a list of Float objects associated with the given configuration key.int[]
getIntArray(java.lang.String key)
Get an array of int primitives associated with the given configuration key.int[]
getIntArray(java.lang.String key, int[] defaultValue)
Get an array of int primitives associated with the given configuration key.java.util.List<java.lang.Integer>
getIntegerList(java.lang.String key)
Get a list of Integer objects associated with the given configuration key.java.util.List<java.lang.Integer>
getIntegerList(java.lang.String key, java.util.List<java.lang.Integer> defaultValue)
Get a list of Integer objects associated with the given configuration key.java.util.Iterator<java.lang.String>
getKeys()
Get the list of the keys contained in the configuration.<T> java.util.List<T>
getList(java.lang.Class<T> cls, java.lang.String key)
Get a list of typed objects associated with the given configuration key.<T> java.util.List<T>
getList(java.lang.Class<T> cls, java.lang.String key, java.util.List<T> defaultValue)
Get a list of typed objects associated with the given configuration key.java.util.Locale
getLocale(java.lang.String key)
Get a Locale associated with the given configuration key.java.util.Locale
getLocale(java.lang.String key, java.util.Locale defaultValue)
Get a Locale associated with the given configuration key.java.util.Locale[]
getLocaleArray(java.lang.String key)
Get an array of Locales associated with the given configuration key.java.util.Locale[]
getLocaleArray(java.lang.String key, java.util.Locale[] defaultValue)
Get an array of Locales associated with the given configuration key.java.util.List<java.util.Locale>
getLocaleList(java.lang.String key)
Get a list of Locales associated with the given configuration key.java.util.List<java.util.Locale>
getLocaleList(java.lang.String key, java.util.List<java.util.Locale> defaultValue)
Get a list of Locales associated with the given configuration key.long[]
getLongArray(java.lang.String key)
Get an array of long primitives associated with the given configuration key.long[]
getLongArray(java.lang.String key, long[] defaultValue)
Get an array of long primitives associated with the given configuration key.java.util.List<java.lang.Long>
getLongList(java.lang.String key)
Get a list of Long objects associated with the given configuration key.java.util.List<java.lang.Long>
getLongList(java.lang.String key, java.util.List<java.lang.Long> defaultValue)
Get a list of Long objects associated with the given configuration key.java.lang.Object
getProperty(java.lang.String key)
Gets a property from the configuration.short[]
getShortArray(java.lang.String key)
Get an array of short primitives associated with the given configuration key.short[]
getShortArray(java.lang.String key, short[] defaultValue)
Get an array of short primitives associated with the given configuration key.java.util.List<java.lang.Short>
getShortList(java.lang.String key)
Get a list of Short objects associated with the given configuration key.java.util.List<java.lang.Short>
getShortList(java.lang.String key, java.util.List<java.lang.Short> defaultValue)
Get a list of Short objects associated with the given configuration key.java.net.URL
getURL(java.lang.String key)
Get an URL associated with the given configuration key.java.net.URL
getURL(java.lang.String key, java.net.URL defaultValue)
Get an URL associated with the given configuration key.java.net.URL[]
getURLArray(java.lang.String key)
Get an array of URLs associated with the given configuration key.java.net.URL[]
getURLArray(java.lang.String key, java.net.URL[] defaultValue)
Get an array of URLs associated with the given configuration key.java.util.List<java.net.URL>
getURLList(java.lang.String key)
Get a list of URLs associated with the given configuration key.java.util.List<java.net.URL>
getURLList(java.lang.String key, java.util.List<java.net.URL> defaultValue)
Get a list of URLs associated with the given configuration key.boolean
isEmpty()
Check if the configuration is empty.void
setProperty(java.lang.String key, java.lang.Object value)
Set a property, this will replace any previously set values.-
Methods inherited from class org.apache.commons.configuration.AbstractConfiguration
addErrorLogListener, append, clear, clearPropertyDirect, copy, createInterpolator, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDefaultListDelimiter, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getList, getList, getListDelimiter, getLogger, getLong, getLong, getLong, getProperties, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, getSubstitutor, interpolate, interpolate, interpolatedConfiguration, interpolateHelper, isDelimiterParsingDisabled, isScalarValue, isThrowExceptionOnMissing, resolveContainerStore, setDefaultListDelimiter, setDelimiter, setDelimiterParsingDisabled, setListDelimiter, setLogger, setThrowExceptionOnMissing, subset
-
Methods inherited from class org.apache.commons.configuration.event.EventSource
addConfigurationListener, addErrorListener, clearConfigurationListeners, clearErrorListeners, clone, createErrorEvent, createEvent, fireError, fireEvent, getConfigurationListeners, getErrorListeners, isDetailEvents, removeConfigurationListener, removeErrorListener, setDetailEvents
-
-
-
-
Field Detail
-
DATE_FORMAT_KEY
public static final java.lang.String DATE_FORMAT_KEY
The key of the property storing the user defined date format.- See Also:
- Constant Field Values
-
DEFAULT_DATE_FORMAT
public static final java.lang.String DEFAULT_DATE_FORMAT
The default format for dates.- See Also:
- Constant Field Values
-
configuration
protected Configuration configuration
Stores the wrapped configuration.
-
-
Constructor Detail
-
DataConfiguration
public DataConfiguration(Configuration configuration)
Creates a new instance ofDataConfiguration
and sets the wrapped configuration.- Parameters:
configuration
- the wrapped configuration
-
-
Method Detail
-
getConfiguration
public Configuration getConfiguration()
Return the configuration decorated by this DataConfiguration.- Returns:
- the wrapped configuration
-
getProperty
public java.lang.Object getProperty(java.lang.String key)
Description copied from interface:Configuration
Gets a property from the configuration. This is the most basic get method for retrieving values of properties. In a typical implementation of theConfiguration
interface the other get methods (that return specific data types) will internally make use of this method. On this level variable substitution is not yet performed. The returned object is an internal representation of the property value for the passed in key. It is owned by theConfiguration
object. So a caller should not modify this object. It cannot be guaranteed that this object will stay constant over time (i.e. further update operations on the configuration may change its internal state).- Specified by:
getProperty
in interfaceConfiguration
- Parameters:
key
- property to retrieve- Returns:
- the value to which this configuration maps the specified key, or null if the configuration contains no mapping for this key.
-
addPropertyDirect
protected void addPropertyDirect(java.lang.String key, java.lang.Object obj)
Description copied from class:AbstractConfiguration
Adds a key/value pair to the Configuration. Override this method to provide write access to underlying Configuration store.- Specified by:
addPropertyDirect
in classAbstractConfiguration
- Parameters:
key
- key to use for mappingobj
- object to store
-
addProperty
public void addProperty(java.lang.String key, java.lang.Object value)
Description copied from interface:Configuration
Add a property to the configuration. If it already exists then the value stated here will be added to the configuration entry. For example, if the property:resource.loader = file
is already present in the configuration and you calladdProperty("resource.loader", "classpath")
Then you will end up with a List like the following:["file", "classpath"]
- Specified by:
addProperty
in interfaceConfiguration
- Overrides:
addProperty
in classAbstractConfiguration
- Parameters:
key
- The key to add the property to.value
- The value to add.
-
isEmpty
public boolean isEmpty()
Description copied from interface:Configuration
Check if the configuration is empty.- Specified by:
isEmpty
in interfaceConfiguration
- Returns:
true
if the configuration contains no property,false
otherwise.
-
containsKey
public boolean containsKey(java.lang.String key)
Description copied from interface:Configuration
Check if the configuration contains the specified key.- Specified by:
containsKey
in interfaceConfiguration
- Parameters:
key
- the key whose presence in this configuration is to be tested- Returns:
true
if the configuration contains a value for this key,false
otherwise
-
clearProperty
public void clearProperty(java.lang.String key)
Description copied from class:AbstractConfiguration
Removes the specified property from this configuration. This implementation performs some preparations and then delegates toclearPropertyDirect()
, which will do the real work.- Specified by:
clearProperty
in interfaceConfiguration
- Overrides:
clearProperty
in classAbstractConfiguration
- Parameters:
key
- the key to be removed
-
setProperty
public void setProperty(java.lang.String key, java.lang.Object value)
Description copied from interface:Configuration
Set a property, this will replace any previously set values. Set values is implicitly a call to clearProperty(key), addProperty(key, value).- Specified by:
setProperty
in interfaceConfiguration
- Overrides:
setProperty
in classAbstractConfiguration
- Parameters:
key
- The key of the property to changevalue
- The new value
-
getKeys
public java.util.Iterator<java.lang.String> getKeys()
Description copied from interface:Configuration
Get the list of the keys contained in the configuration. The returned iterator can be used to obtain all defined keys. Note that the exact behavior of the iterator'sremove()
method is specific to a concrete implementation. It may remove the corresponding property from the configuration, but this is not guaranteed. In any case it is no replacement for callingConfiguration.clearProperty(String)
for this property. So it is highly recommended to avoid using the iterator'sremove()
method.- Specified by:
getKeys
in interfaceConfiguration
- Returns:
- An Iterator.
-
get
public <T> T get(java.lang.Class<T> cls, java.lang.String key)
Get an object of the specified type associated with the given configuration key. If the key doesn't map to an existing object, the method returns null unlessAbstractConfiguration.isThrowExceptionOnMissing()
is set to true.- Type Parameters:
T
- the target type of the value- Parameters:
cls
- the target class of the valuekey
- the key of the value- Returns:
- the value of the requested type for the key
- Throws:
java.util.NoSuchElementException
- if the key doesn't map to an existing object and throwExceptionOnMissing=trueConversionException
- if the value is not compatible with the requested type- Since:
- 1.5
-
get
public <T> T get(java.lang.Class<T> cls, java.lang.String key, T defaultValue)
Get an object of the specified type associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.- Type Parameters:
T
- the target type of the value- Parameters:
cls
- the target class of the valuekey
- the key of the valuedefaultValue
- the default value- Returns:
- the value of the requested type for the key
- Throws:
ConversionException
- if the value is not compatible with the requested type- Since:
- 1.5
-
getList
public <T> java.util.List<T> getList(java.lang.Class<T> cls, java.lang.String key)
Get a list of typed objects associated with the given configuration key. If the key doesn't map to an existing object, an empty list is returned.- Type Parameters:
T
- the type expected for the elements of the list- Parameters:
cls
- the class expected for the elements of the listkey
- The configuration key.- Returns:
- The associated list if the key is found.
- Throws:
ConversionException
- is thrown if the key maps to an object that is not compatible with a list of the specified class.- Since:
- 1.5
-
getList
public <T> java.util.List<T> getList(java.lang.Class<T> cls, java.lang.String key, java.util.List<T> defaultValue)
Get a list of typed objects associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.- Type Parameters:
T
- the type expected for the elements of the list- Parameters:
cls
- the class expected for the elements of the listkey
- the configuration key.defaultValue
- the default value.- Returns:
- The associated List.
- Throws:
ConversionException
- is thrown if the key maps to an object that is not compatible with a list of the specified class.- Since:
- 1.5
-
getArray
public java.lang.Object getArray(java.lang.Class<?> cls, java.lang.String key)
Get an array of typed objects associated with the given configuration key. If the key doesn't map to an existing object, an empty list is returned.- Parameters:
cls
- the type expected for the elements of the arraykey
- The configuration key.- Returns:
- The associated array if the key is found, and the value compatible with the type specified.
- Throws:
ConversionException
- is thrown if the key maps to an object that is not compatible with a list of the specified class.- Since:
- 1.5
-
getArray
public java.lang.Object getArray(java.lang.Class<?> cls, java.lang.String key, java.lang.Object defaultValue)
Get an array of typed objects associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.- Parameters:
cls
- the type expected for the elements of the arraykey
- the configuration key.defaultValue
- the default value- Returns:
- The associated array if the key is found, and the value compatible with the type specified.
- Throws:
ConversionException
- is thrown if the key maps to an object that is not compatible with an array of the specified class.java.lang.IllegalArgumentException
- if the default value is not an array of the specified type- Since:
- 1.5
-
getBooleanList
public java.util.List<java.lang.Boolean> getBooleanList(java.lang.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 java.util.List<java.lang.Boolean> getBooleanList(java.lang.String key, java.util.List<java.lang.Boolean> 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 Booleans.
- Throws:
ConversionException
- is thrown if the key maps to an object that is not a list of booleans.
-
getBooleanArray
public boolean[] getBooleanArray(java.lang.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(java.lang.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.
-
getByteList
public java.util.List<java.lang.Byte> getByteList(java.lang.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 java.util.List<java.lang.Byte> getByteList(java.lang.String key, java.util.List<java.lang.Byte> 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.
-
getByteArray
public byte[] getByteArray(java.lang.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(java.lang.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.
-
getShortList
public java.util.List<java.lang.Short> getShortList(java.lang.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 java.util.List<java.lang.Short> getShortList(java.lang.String key, java.util.List<java.lang.Short> 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.
-
getShortArray
public short[] getShortArray(java.lang.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(java.lang.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.
-
getIntegerList
public java.util.List<java.lang.Integer> getIntegerList(java.lang.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 java.util.List<java.lang.Integer> getIntegerList(java.lang.String key, java.util.List<java.lang.Integer> 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.
-
getIntArray
public int[] getIntArray(java.lang.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(java.lang.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.
-
getLongList
public java.util.List<java.lang.Long> getLongList(java.lang.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 java.util.List<java.lang.Long> getLongList(java.lang.String key, java.util.List<java.lang.Long> 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.
-
getLongArray
public long[] getLongArray(java.lang.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(java.lang.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.
-
getFloatList
public java.util.List<java.lang.Float> getFloatList(java.lang.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 java.util.List<java.lang.Float> getFloatList(java.lang.String key, java.util.List<java.lang.Float> 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.
-
getFloatArray
public float[] getFloatArray(java.lang.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(java.lang.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.
-
getDoubleList
public java.util.List<java.lang.Double> getDoubleList(java.lang.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 java.util.List<java.lang.Double> getDoubleList(java.lang.String key, java.util.List<java.lang.Double> 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.
-
getDoubleArray
public double[] getDoubleArray(java.lang.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(java.lang.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.
-
getBigIntegerList
public java.util.List<java.math.BigInteger> getBigIntegerList(java.lang.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 java.util.List<java.math.BigInteger> getBigIntegerList(java.lang.String key, java.util.List<java.math.BigInteger> 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.
-
getBigIntegerArray
public java.math.BigInteger[] getBigIntegerArray(java.lang.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 java.math.BigInteger[] getBigIntegerArray(java.lang.String key, java.math.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.
-
getBigDecimalList
public java.util.List<java.math.BigDecimal> getBigDecimalList(java.lang.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 java.util.List<java.math.BigDecimal> getBigDecimalList(java.lang.String key, java.util.List<java.math.BigDecimal> 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.
-
getBigDecimalArray
public java.math.BigDecimal[] getBigDecimalArray(java.lang.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 java.math.BigDecimal[] getBigDecimalArray(java.lang.String key, java.math.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.
-
getURL
public java.net.URL getURL(java.lang.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 java.net.URL getURL(java.lang.String key, java.net.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.
-
getURLList
public java.util.List<java.net.URL> getURLList(java.lang.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 java.util.List<java.net.URL> getURLList(java.lang.String key, java.util.List<java.net.URL> 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.
-
getURLArray
public java.net.URL[] getURLArray(java.lang.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 java.net.URL[] getURLArray(java.lang.String key, java.net.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.
-
getDate
public java.util.Date getDate(java.lang.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 theDATE_FORMAT_KEY
property, or if it's not defined with theDEFAULT_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 java.util.Date getDate(java.lang.String key, java.lang.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-localizedDateFormat
pattern.- Returns:
- The associated Date
- Throws:
ConversionException
- is thrown if the key maps to an object that is not a Date.
-
getDate
public java.util.Date getDate(java.lang.String key, java.util.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 theDATE_FORMAT_KEY
property, or if it's not defined with theDEFAULT_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 java.util.Date getDate(java.lang.String key, java.util.Date defaultValue, java.lang.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-localizedDateFormat
pattern.- Returns:
- The associated Date.
- Throws:
ConversionException
- is thrown if the key maps to an object that is not a Date.
-
getDateList
public java.util.List<java.util.Date> getDateList(java.lang.String key)
-
getDateList
public java.util.List<java.util.Date> getDateList(java.lang.String key, java.lang.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-localizedDateFormat
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 java.util.List<java.util.Date> getDateList(java.lang.String key, java.util.List<java.util.Date> 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 theDATE_FORMAT_KEY
property, or if it's not defined with theDEFAULT_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 java.util.List<java.util.Date> getDateList(java.lang.String key, java.util.List<java.util.Date> defaultValue, java.lang.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-localizedDateFormat
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.
-
getDateArray
public java.util.Date[] getDateArray(java.lang.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 theDATE_FORMAT_KEY
property, or if it's not defined with theDEFAULT_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 java.util.Date[] getDateArray(java.lang.String key, java.lang.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-localizedDateFormat
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 java.util.Date[] getDateArray(java.lang.String key, java.util.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 theDATE_FORMAT_KEY
property, or if it's not defined with theDEFAULT_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 java.util.Date[] getDateArray(java.lang.String key, java.util.Date[] defaultValue, java.lang.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-localizedDateFormat
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.
-
getCalendar
public java.util.Calendar getCalendar(java.lang.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 theDATE_FORMAT_KEY
property, or if it's not defined with theDEFAULT_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 java.util.Calendar getCalendar(java.lang.String key, java.lang.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-localizedDateFormat
pattern.- Returns:
- The associated Calendar
- Throws:
ConversionException
- is thrown if the key maps to an object that is not a Calendar.
-
getCalendar
public java.util.Calendar getCalendar(java.lang.String key, java.util.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 theDATE_FORMAT_KEY
property, or if it's not defined with theDEFAULT_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 java.util.Calendar getCalendar(java.lang.String key, java.util.Calendar defaultValue, java.lang.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-localizedDateFormat
pattern.- Returns:
- The associated Calendar.
- Throws:
ConversionException
- is thrown if the key maps to an object that is not a Calendar.
-
getCalendarList
public java.util.List<java.util.Calendar> getCalendarList(java.lang.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 theDATE_FORMAT_KEY
property, or if it's not defined with theDEFAULT_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 java.util.List<java.util.Calendar> getCalendarList(java.lang.String key, java.lang.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-localizedDateFormat
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 java.util.List<java.util.Calendar> getCalendarList(java.lang.String key, java.util.List<java.util.Calendar> 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 theDATE_FORMAT_KEY
property, or if it's not defined with theDEFAULT_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 java.util.List<java.util.Calendar> getCalendarList(java.lang.String key, java.util.List<java.util.Calendar> defaultValue, java.lang.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-localizedDateFormat
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.
-
getCalendarArray
public java.util.Calendar[] getCalendarArray(java.lang.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 theDATE_FORMAT_KEY
property, or if it's not defined with theDEFAULT_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 java.util.Calendar[] getCalendarArray(java.lang.String key, java.lang.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-localizedDateFormat
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 java.util.Calendar[] getCalendarArray(java.lang.String key, java.util.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 theDATE_FORMAT_KEY
property, or if it's not defined with theDEFAULT_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 java.util.Calendar[] getCalendarArray(java.lang.String key, java.util.Calendar[] defaultValue, java.lang.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-localizedDateFormat
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.
-
getLocale
public java.util.Locale getLocale(java.lang.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 java.util.Locale getLocale(java.lang.String key, java.util.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.
-
getLocaleList
public java.util.List<java.util.Locale> getLocaleList(java.lang.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 java.util.List<java.util.Locale> getLocaleList(java.lang.String key, java.util.List<java.util.Locale> 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.
-
getLocaleArray
public java.util.Locale[] getLocaleArray(java.lang.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 java.util.Locale[] getLocaleArray(java.lang.String key, java.util.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.
-
getColor
public java.awt.Color getColor(java.lang.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 java.awt.Color getColor(java.lang.String key, java.awt.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.
-
getColorList
public java.util.List<java.awt.Color> getColorList(java.lang.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 java.util.List<java.awt.Color> getColorList(java.lang.String key, java.util.List<java.awt.Color> 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.
-
getColorArray
public java.awt.Color[] getColorArray(java.lang.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 java.awt.Color[] getColorArray(java.lang.String key, java.awt.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.
-
-