edu.rice.cs.drjava.config
Class StringOption
java.lang.Object
edu.rice.cs.drjava.config.OptionParser<T>
edu.rice.cs.drjava.config.Option<String>
edu.rice.cs.drjava.config.StringOption
- All Implemented Interfaces:
- FormatStrategy<String>, ParseStrategy<String>
public class StringOption
- extends Option<String>
Class representing all configuration options with values of type String.
- Version:
- $Id: StringOption.java 4419 2008-03-27 06:58:07Z rcartwright $
StringOption
public StringOption(String key,
String def)
- Parameters:
key - The name of this Option.
parse
public String parse(String s)
- Description copied from class:
OptionParser
- 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<String>- Specified by:
parse in class OptionParser<String>
- Parameters:
s - The String to be parsed.
- Returns:
- "s", no actual parsing is performed.
format
public String format(String s)
- Description copied from class:
Option
- Formats a statically typed T value as a String. The default implementation uses the toString() method.
- Specified by:
format in interface FormatStrategy<String>- Overrides:
format in class Option<String>
- Parameters:
s - The String to be formatted.
- Returns:
- "s", no actual formatting is performed.