edu.rice.cs.drjava.config
Class FileOption
java.lang.Object
edu.rice.cs.drjava.config.OptionParser<T>
edu.rice.cs.drjava.config.Option<File>
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 $
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. |
FileOption
public FileOption(String key,
File def)
- Parameters:
key
- The name of this option.
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".