net.sourceforge.sqlunit
Class TypeFactory

java.lang.Object
  extended by net.sourceforge.sqlunit.TypeFactory

public final class TypeFactory
extends java.lang.Object

Factory for generating concrete implementations of IType.

Version:
$Revision: 1.6 $
Author:
Ralph Brendler (rbrendler@users.sourceforge.net), Sujit Pal (spal@users.sourceforge.net)

Method Summary
static IType getInstance(int typeId)
          Given an SQL Type Id, instantiates and returns a partially populated IType object of the specified type.
static IType getInstance(java.lang.String name)
          Given an XML type name, instantiates and returns a partially populated IType object of the specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IType getInstance(java.lang.String name)
                         throws SQLUnitException
Given an XML type name, instantiates and returns a partially populated IType object of the specified type.

Parameters:
name - the XML name for the type. The database server name is implicitly provided by looking up the metadata for the current Connection. If there is no match, then the type name without the server-name (ie server non-specific type) is looked up.
Returns:
a partially populated IType object of the named type.
Throws:
SQLUnitException - if there was a problem.

getInstance

public static IType getInstance(int typeId)
                         throws SQLUnitException
Given an SQL Type Id, instantiates and returns a partially populated IType object of the specified type.

Parameters:
typeId - an integer that exists in one of the SQLUnit type mapping properties files.
Returns:
an IType object of the specified type.
Throws:
SQLUnitException - if there was a problem.