org.apache.ddlutils.io.converters
Class NumberConverter

java.lang.Object
  extended by org.apache.ddlutils.io.converters.NumberConverter
All Implemented Interfaces:
SqlTypeConverter

public class NumberConverter
extends Object
implements SqlTypeConverter

Converts between the various number types (including boolean types) and String.

Version:
$Revision: 289996 $

Constructor Summary
NumberConverter()
           
 
Method Summary
 Object convertFromString(String textRep, int sqlTypeCode)
          Converts the given textual representation to an instance of the target type.
 String convertToString(Object obj, int sqlTypeCode)
          Converts the given object to a string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberConverter

public NumberConverter()
Method Detail

convertFromString

public Object convertFromString(String textRep,
                                int sqlTypeCode)
                         throws ConversionException
Converts the given textual representation to an instance of the target type.

Specified by:
convertFromString in interface SqlTypeConverter
Parameters:
textRep - The textual representation
sqlTypeCode - The target sql type code, one of the constants in Types
Returns:
The corresponding object
Throws:
ConversionException

convertToString

public String convertToString(Object obj,
                              int sqlTypeCode)
                       throws ConversionException
Converts the given object to a string representation.

Specified by:
convertToString in interface SqlTypeConverter
Parameters:
obj - The object
sqlTypeCode - The corresponding source type code
Returns:
The textual representation
Throws:
ConversionException


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.