org.dbunit.dataset.sqlloader
Class SqlLoaderControlProducer

java.lang.Object
  extended by org.dbunit.dataset.sqlloader.SqlLoaderControlProducer
All Implemented Interfaces:
IDataSetProducer

public class SqlLoaderControlProducer
extends Object
implements IDataSetProducer

Producer that creates an IDataSet using SQLLoader style '.ctl' files.

Since:
2.4.0
Version:
$Revision: 855 $ $Date: 2008-11-01 15:23:09 +0100 (Sat, 01 Nov 2008) $
Author:
Stephan Strittmatter (stritti AT users.sourceforge.net), gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Field Summary
static String NULL
          The Constant NULL.
 
Constructor Summary
SqlLoaderControlProducer(File controlFilesDir, File tableOrderFile)
          The Constructor.
SqlLoaderControlProducer(File controlFilesDir, List orderedTableNames)
          The Constructor.
SqlLoaderControlProducer(String controlFilesDir, String tableOrderFile)
          The Constructor.
 
Method Summary
static List getTables(File controlFilesDir, File tableList)
          Get a list of tables that this producer will create.
 void produce()
          Process this dataset source.
 void setConsumer(IDataSetConsumer consumer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

public static final String NULL
The Constant NULL.

See Also:
Constant Field Values
Constructor Detail

SqlLoaderControlProducer

public SqlLoaderControlProducer(String controlFilesDir,
                                String tableOrderFile)
                         throws DataSetException
The Constructor.

Parameters:
controlFilesDir - the control files directory
tableOrderFile - the table order file
Throws:
DataSetException

SqlLoaderControlProducer

public SqlLoaderControlProducer(File controlFilesDir,
                                File tableOrderFile)
                         throws DataSetException
The Constructor.

Parameters:
controlFilesDir - the control files directory
tableOrderFile - the table order file
Throws:
DataSetException

SqlLoaderControlProducer

public SqlLoaderControlProducer(File controlFilesDir,
                                List orderedTableNames)
The Constructor.

Parameters:
controlFilesDir - the control files directory
orderedTableNames - a list of strings that contains the ordered table names
Method Detail

setConsumer

public void setConsumer(IDataSetConsumer consumer)
                 throws DataSetException
Specified by:
setConsumer in interface IDataSetProducer
Throws:
DataSetException
See Also:
IDataSetProducer.setConsumer(org.dbunit.dataset.stream.IDataSetConsumer)

produce

public void produce()
             throws DataSetException
Description copied from interface: IDataSetProducer
Process this dataset source. During the processing, the IDataSetProducer will provide information about the dataset through the specified event listener.

This method is synchronous: it will not return until processing has ended. If a client application wants to terminate parsing early, it should throw an exception from the listener.

Specified by:
produce in interface IDataSetProducer
Throws:
DataSetException
See Also:
IDataSetProducer.produce()

getTables

public static List getTables(File controlFilesDir,
                             File tableList)
                      throws IOException
Get a list of tables that this producer will create.

Parameters:
controlFilesDir - the base directory
tableList - the table list
Returns:
a list of Strings, where each item is a CSV file relative to the base URL
Throws:
IOException - when IO on the base URL has issues.


Copyright © 2002-2012. All Rights Reserved.