com.ibm.as400.ui.framework.java
Class DataFormatter

java.lang.Object
  extended by com.ibm.as400.ui.framework.java.DataFormatter
Direct Known Subclasses:
AS400Formatter, DateFormatter, FloatFormatter, InternetAddressFormatter, IntFormatter, LongFormatter, PercentFormatter, ShortFormatter, StringFormatter, TimeFormatter

public class DataFormatter
extends Object

The base class for objects which format data that is exchanged between DataBeans and user interface components. DataFormatter defines the programming interface for formatting data for presentation (the format method) and for parsing user data into a form suitable for use by DataBeans (the parse method). If parsing is unsuccessful, an IllegalUserDataException is thrown.

The base class implementations of format and parse merely return their arguments with leading and trailing blanks removed.

Since:
v4r2m0
Version:
1.0, 04/15/98
Author:
D. Petty
See Also:
DataBean, IllegalUserDataException

Constructor Summary
Constructor and Description
DataFormatter()
          Constructs a DataFormatter.
 
Method Summary
Modifier and Type Method and Description
 String format(Object obj)
          Formats an object to produce a string.
 Object parse(String source)
          Parses a string to produce an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataFormatter

public DataFormatter()
Constructs a DataFormatter.

Since:
v4r2m0
Method Detail

format

public String format(Object obj)
Formats an object to produce a string.

Parameters:
obj - the object to format
Returns:
formatted string
Since:
v4r2m0

parse

public Object parse(String source)
             throws IllegalArgumentException
Parses a string to produce an object.

Parameters:
source - the string to be parsed
Returns:
the object obtained by parsing the string
Throws:
IllegalArgumentException
Since:
v4r2m0