3.1.2: 2012-07-31

net.sf.basedb.clients.web.plugins
Class BioMaterialEventSourceFormatter

java.lang.Object
  extended by net.sf.basedb.clients.web.plugins.BioMaterialEventSourceFormatter
All Implemented Interfaces:
Formatter<BioMaterialEventSource>

public class BioMaterialEventSourceFormatter
extends Object
implements Formatter<BioMaterialEventSource>

Formatter to handle BioMaterialEventSource items. It will print the name + used quantity from the source item.

Version:
3.1
Author:
Nicklas
Last modified
$Dat$

Field Summary
private  String nullValue
           
 
Constructor Summary
BioMaterialEventSourceFormatter()
          Create a new formatter.
BioMaterialEventSourceFormatter(String nullValue)
          Create a new formatter.
 
Method Summary
 String format(BioMaterialEventSource eventSource)
          Format a value by converting it to a string.
 BioMaterialEventSource 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

BioMaterialEventSourceFormatter

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


BioMaterialEventSourceFormatter

public BioMaterialEventSourceFormatter(String nullValue)
Create a new formatter.

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

format

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

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

parseString

public BioMaterialEventSource 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<BioMaterialEventSource>
Parameters:
value - The string to parse
Returns:
An object
Throws:
UnsupportedOperationException - Always

3.1.2: 2012-07-31