thinkui.parser
Class TextFileParser
java.lang.Object
thinkui.parser.AbstractFileParser
thinkui.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.
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 |
TextFileParser
public TextFileParser()
- TextFileParser constructor.
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)
Copyright © 2007-2009. ThinkUI Software Inc. All rights reserved.