com.ibm.ulc.ui.dataTypes
Interface IDataType

All Known Implementing Classes:
UIDataType

public abstract interface IDataType

Defines the interaction between UIFields and Data types


Method Summary
 java.lang.Object convertToObject(int phase, java.lang.String newString, java.lang.Object previousValue)
          Convert a String into the object represented by this DataType.
 java.lang.String convertToString(java.lang.Object object, boolean forEditing)
          Convert an object into a String.
 java.lang.String filterInput(java.lang.String newString)
          Hook to filter any text input into the field.
 java.lang.String filterInput(java.lang.String newString, java.lang.String oldText)
          Hook to filter any text input into the field.
 int getCols()
          Returns the default width (in characters) used to determine the size of a field or table and list column of this DataType.
 java.lang.Object getDefaultValue(java.lang.String newString)
          Returns the default object to be returned when a data conversion error occurs.
 

Method Detail

convertToObject

public java.lang.Object convertToObject(int phase,
                                        java.lang.String newString,
                                        java.lang.Object previousValue)
                                 throws DataTypeConversionException
Convert a String into the object represented by this DataType. If the String cannot be converted the implementation has to throw the DataTypeConversionException exception. The return value null is a legal value!
Parameters:
phase - int The current validation phase. The phase can be one of the following:
	FORM_NOTIFICATION_IMMEDIATE : Typically no validation is performed in this case the input string is returned as is.
	FORM_NOTIFICATION_ON_FOCUS_CHANGE 	 
 	FORM_NOTIFICATION_ON_REQUEST
	
newString - The String to convert.
Returns:
An object representing the converted String or null.

convertToString

public java.lang.String convertToString(java.lang.Object object,
                                        boolean forEditing)
Convert an object into a String. The boolean flag determines whether the string is used for editing (the field has the focus) or for displaying. In the first case the String representation should be easy to edit and shouldn't include any fancy formatting.
Parameters:
object - Object to convert.
forEditing - True if string is used for editing.

filterInput

public java.lang.String filterInput(java.lang.String newString)
Hook to filter any text input into the field.
Parameters:
newString - The string to filter.
Returns:
the filtered result, If null input is not accepted.

filterInput

public java.lang.String filterInput(java.lang.String newString,
                                    java.lang.String oldText)
Hook to filter any text input into the field.
Parameters:
newString - The string to filter.
oldText - The current Contents.
Returns:
the filtered result, If null input is not accepted.

getCols

public int getCols()
Returns the default width (in characters) used to determine the size of a field or table and list column of this DataType. Can be overidden by giving the field an explicit size.

getDefaultValue

public java.lang.Object getDefaultValue(java.lang.String newString)
Returns the default object to be returned when a data conversion error occurs.