.
Field Summary |
private Object |
defaultValue
|
(package private) gj.util.Hashtable |
map
an inner hashtable that maps DefaultOptionMaps to value T's. |
String |
name
The logical name of this configurable option (i.e. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
name
public final String name
- The logical name of this configurable option (i.e. "indent.size")
public because it's final, and a String is immutable.
defaultValue
private final Object defaultValue
map
final gj.util.Hashtable map
- an inner hashtable that maps DefaultOptionMaps to value T's.
part of the magic inner workings of this package.
OptionParser
public OptionParser(String name,
Object def)
- constructor that takes in a name
- Parameters:
name
- the name of this option (i.e. "indent.level");
getName
public String getName()
- accessor for name option
- Returns:
- name of this option (i.e. "indent.level")
getDefault
public Object getDefault()
- Returns:
- the default value
getDefaultString
public abstract String getDefaultString()
- Returns:
- the default value as a string
parse
public abstract Object parse(String value)
- the ability to parse a string to an object of type T. All concrete versions of this
class must override this method to provide some sort of parser implementation.
- Specified by:
parse
in interface ParseStrategy
- Parameters:
value
- a String to parse- Returns:
- the statically-typed representation of the string value.
getString
abstract String getString(DefaultOptionMap om)
setString
Object setString(DefaultOptionMap om,
String val)
- uses parse() and setOption() so that any changes in parsing will automatically
be applied to setString().
getOption
Object getOption(DefaultOptionMap om)
- the accessor for the magic-typed hashtable stunt.
setOption
Object setOption(DefaultOptionMap om,
Object val)
- the mutator for the magic-typed hashtable stunt.
remove
Object remove(DefaultOptionMap om)
- the destructor for a mapping in the magic-typed hashtable.