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

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

public class DataFormatter
extends java.lang.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
See Also:
DataBean, IllegalUserDataException

Constructor Summary
DataFormatter()
          Constructs a DataFormatter.
 
Method Summary
 java.lang.String format(java.lang.Object obj)
          Formats an object to produce a string.
 java.lang.Object parse(java.lang.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 java.lang.String format(java.lang.Object obj)
Formats an object to produce a string.
Parameters:
obj - the object to format
Returns:
formatted string
Since:
v4r2m0

parse

public java.lang.Object parse(java.lang.String source)
                       throws java.lang.IllegalArgumentException
Parses a string to produce an object.
Parameters:
source - the string to be parsed
Returns:
the object obtained by parsing the string
Since:
v4r2m0