2.17.2: 2011-06-17

net.sf.basedb.util.formatter
Class FilePathFormatter

java.lang.Object
  extended by net.sf.basedb.util.formatter.FilePathFormatter
All Implemented Interfaces:
Formatter<File>

public class FilePathFormatter
extends Object
implements Formatter<File>

Formatter implementation that format File items to their complete paths.

Version:
2.16
Author:
Nicklas
Last modified
$Date $

Field Summary
private  String nullValue
           
 
Constructor Summary
FilePathFormatter()
          Create a new formatter.
FilePathFormatter(String nullValue)
          Create a new formatter.
 
Method Summary
 String format(File file)
          Format a value by converting it to a string.
 File parseString(String value)
          Parse a string and return a value of the correct type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nullValue

private String nullValue
Constructor Detail

FilePathFormatter

public FilePathFormatter()
Create a new formatter. Null values are formatted as an empty string.


FilePathFormatter

public FilePathFormatter(String nullValue)
Create a new formatter.

Parameters:
nullValue - The string to return if a null item is passed to format(File)
Method Detail

format

public String format(File file)
Description copied from interface: Formatter
Format a value by converting it to a string.

Specified by:
format in interface Formatter<File>
Parameters:
file - The value to format
Returns:
A formatted string

parseString

public File parseString(String value)
Description copied from interface: Formatter
Parse a string and return a value of the correct type. A null input string should (unless otherwise documented by a specific formatter implementation) be allowed and may return null or any other "default" value.

Specified by:
parseString in interface Formatter<File>
Parameters:
value - The string to parse
Returns:
An object
Throws:
UnsupportedOperationException - Always

2.17.2: 2011-06-17