edu.rice.cs.drjava.config
Class FileOption

java.lang.Object
  extended by edu.rice.cs.drjava.config.OptionParser<T>
      extended by edu.rice.cs.drjava.config.Option<File>
          extended by edu.rice.cs.drjava.config.FileOption
All Implemented Interfaces:
FormatStrategy<File>, ParseStrategy<File>

public class FileOption
extends Option<File>

Class representing all configuration options with values of type File.

Version:
$Id: FileOption.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
FileOption(String key, File def)
           
 
Method Summary
 String format(File f)
          Formats a statically typed T value as a String.
 File 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

FileOption

public FileOption(String key,
                  File def)
Parameters:
key - The name of this option.
Method Detail

parse

public File 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<File>
Specified by:
parse in class OptionParser<File>
Parameters:
s - The String to be parsed, must represent a legal file path for the File to be created.
Returns:
The absolute File object corresponding to the input path string.

format

public String format(File f)
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<File>
Overrides:
format in class Option<File>
Parameters:
f - The instance of class File to be formatted.
Returns:
A String representing the absolute path of "f".