ThinkUI SQL Client 1.1.3 API

thinkui.parser
Class TextFileParser

java.lang.Object
  extended bythinkui.parser.AbstractFileParser
      extended bythinkui.parser.TextFileParser
All Implemented Interfaces:
thinkui.parser.FileParser

public class TextFileParser
extends AbstractFileParser

Parser for importing data from a text file into a data class. Each line of text is parsed by the configured DataObjectParser.


Constructor Summary
TextFileParser()
          TextFileParser constructor.
 
Method Summary
 DataObjectParser getDataObjectParser()
           
 void importData()
          Parse the file and import into the database.
 void importFile(DataClass dataClass, java.lang.String fileName, int startLine, int maxNumRecords)
          Import the data in the specified file and populate the database.
 void setDataObjectParser(DataObjectParser dataObjectParser)
           
 
Methods inherited from class thinkui.parser.AbstractFileParser
getCommitInterval, getDataClass, getDataObjectManager, getDefaultValues, getFile, getMaxNumRecords, getNumErrors, getNumInserts, getNumWarnings, getStartLine, getStatusInterval, incNumErrors, incNumInserts, incNumWarnings, isDryRun, setCommitInterval, setDataClass, setDataObjectManager, setDefaultValues, setDryRun, setFile, setMaxNumRecords, setStartLine, setStatusInterval
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFileParser

public TextFileParser()
TextFileParser constructor.

Method Detail

getDataObjectParser

public final DataObjectParser getDataObjectParser()

importData

public final void importData()
                      throws java.lang.Exception
Parse the file and import into the database.

Specified by:
importData in interface thinkui.parser.FileParser
Specified by:
importData in class AbstractFileParser
Throws:
java.lang.Exception

importFile

public final void importFile(DataClass dataClass,
                             java.lang.String fileName,
                             int startLine,
                             int maxNumRecords)
                      throws java.lang.Exception
Import the data in the specified file and populate the database. A data object manager must be already configured using the setDataObjectManager() method. If no data object parser has been configured with the setDataObjectParser() method, a CSV parser will be automatically configured for the given data class.

Throws:
java.lang.Exception

setDataObjectParser

public final void setDataObjectParser(DataObjectParser dataObjectParser)

ThinkUI SQL Client 1.1.3 API

Copyright © 2007-2009. ThinkUI Software Inc. All rights reserved.