edu.rice.cs.drjava.config
Class StringOption

java.lang.Object
  extended by edu.rice.cs.drjava.config.OptionParser<T>
      extended by edu.rice.cs.drjava.config.Option<String>
          extended by 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 $

Field Summary
 
Fields inherited from class edu.rice.cs.drjava.config.OptionParser
defaultValue, name
 
Constructor Summary
StringOption(String key, String def)
           
 
Method Summary
 String format(String s)
          Formats a statically typed T value as a String.
 String parse(String s)
          The ability to parse a string to an object of type T.
 
Methods inherited from class edu.rice.cs.drjava.config.Option
getDefaultString
 
Methods inherited from class edu.rice.cs.drjava.config.OptionParser
getDefault, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringOption

public StringOption(String key,
                    String def)
Parameters:
key - The name of this Option.
Method Detail

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.