org.castor.jdo.engine

Class SQLTypeConverters


public final class SQLTypeConverters
extends java.lang.Object

Version:
$Revision: 5951 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
Authors:
Assaf Arkin
Bruce Snyder
Ralf Joachim
Since:
1.0

Nested Class Summary

static class
SQLTypeConverters.Convertor
Abstract class to convert from one type to another.

Method Summary

static TypeConvertor
getConvertor(Class fromType, Class toType)
Returns a type convertor.
static String
getFullDatePattern(String pattern)
Transforms short date format pattern into full format pattern for SimpleDateFormat (e.g., "YMD" to "yyyyMMdd").

Method Details

getConvertor

public static TypeConvertor getConvertor(Class fromType,
                                         Class toType)
            throws MappingException
Returns a type convertor. A type convertor can be used to convert an object from Java type fromType to Java type toType.
Parameters:
fromType - The Java type to convert from.
toType - The Java type to convert to.
Returns:
The TypeConverter to convert fromType into toType.
Throws:
MappingException - No suitable convertor was found.

getFullDatePattern

public static String getFullDatePattern(String pattern)
Transforms short date format pattern into full format pattern for SimpleDateFormat (e.g., "YMD" to "yyyyMMdd").
Parameters:
pattern - The short pattern.
Returns:
The full pattern.

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com