The purpose of this class is to provide a more strongly typed version of a java.util.Properties object. So far it is a read only view of the properties and does not set data into the underlying Properties instance.
Similar to java.util.Properties it will delegate to a "parent" instance when a property is not found. If a property is found but its value cannot be parsed as the desired data type, the parent's value is used.
By default this object will log nothing, but if a Log implementation is set the Options class will log three kinds of statements:
- When a property is not found: the property name and default value in use along with all possible values (enums only). Debug level. - When a property is found: the property name and value. Info level. - When a property value cannot be parsed: the property name and invalid value. Warn level. Logging the user supplied values onto INFO is really nice as it shows up in the standard log output and allows us to easily see which values the user has changed from the default. It's rather impossible to diagnose issues without this information. ENUM SETS: Properties that accept a Set of enum values automatically accept ALL and NONE in addition to the explicitly created enum items. Using ALL. This allows users to have an easy way to imply "all" without having to hardcode an the entire list of enum items and protects against the case where that list may grow in the future. Using NONE. This allows users an alternative to using an empty string when explicitly specifying that none of the options should be used. In the internal code, this allows us to have these concepts in all enum options without us having to add NONE or ALL enum items explicitly which leads to strange code. Additionally TRUE is an alias for ALL and FALSE an alias for NONE. This allows options that used to support only true/false values to be further defined in the future without breaking compatibility.
@version $Rev: 803009 $ $Date: 2009-08-10 23:43:22 -0700 (Mon, 10 Aug 2009) $