ieve 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 {@code 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 {@code org.apache.commons.configuration.format.date}. Alternatively, the date format can also be specified via the {@code ConversionHandler} usedby a configuration instance:
DefaultConversionHandler handler = new DefaultConversionHandler(); handler.setDateFormat("mm/dd/yyyy"); config.setConversionHandler(handler);
@author
Emmanuel Bourg
@version $Id: DataConfiguration.java 1624601 2014-09-12 18:04:36Z oheger $
@since 1.1