Package org.openrefine.importers
Class ImportingParserBase
- java.lang.Object
-
- org.openrefine.importers.ImportingParserBase
-
- All Implemented Interfaces:
ImportingParser
- Direct Known Subclasses:
InputStreamImporter
,ReaderImporter
,TreeImportingParserBase
public abstract class ImportingParserBase extends Object implements ImportingParser
Importer which handles the import of multiple files as a single one.
-
-
Constructor Summary
Constructors Constructor Description ImportingParserBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.node.ObjectNode
createParserUIInitializationData(Runner runner, ImportingJob job, List<ImportingFileRecord> fileRecords, String format)
Create data sufficient for the parser UI on the client side to do its work.Grid
parse(Runner runner, ProjectMetadata metadata, ImportingJob job, List<ImportingFileRecord> fileRecords, String format, long limit, com.fasterxml.jackson.databind.node.ObjectNode options)
Main method of the parser: parse a grid out of input filesGrid
parseOneFile(Runner runner, ProjectMetadata metadata, ImportingJob job, ImportingFileRecord fileRecord, long limit, com.fasterxml.jackson.databind.node.ObjectNode options, MultiFileReadingProgress progress)
-
-
-
Method Detail
-
createParserUIInitializationData
public com.fasterxml.jackson.databind.node.ObjectNode createParserUIInitializationData(Runner runner, ImportingJob job, List<ImportingFileRecord> fileRecords, String format)
Description copied from interface:ImportingParser
Create data sufficient for the parser UI on the client side to do its work. For example, an XML parser UI would need to know some sample elements so it can let the user pick which the path to the record elements.- Specified by:
createParserUIInitializationData
in interfaceImportingParser
-
parse
public Grid parse(Runner runner, ProjectMetadata metadata, ImportingJob job, List<ImportingFileRecord> fileRecords, String format, long limit, com.fasterxml.jackson.databind.node.ObjectNode options) throws Exception
Description copied from interface:ImportingParser
Main method of the parser: parse a grid out of input files- Specified by:
parse
in interfaceImportingParser
- Parameters:
runner
- the runner to use to create the gridmetadata
- the project metadata, to which the importer can contributejob
- the importing job, useful to report importing progressfileRecords
- the files to importformat
- the identifier for the formatlimit
- maximum number of rows to createoptions
- custom options put together by the UI corresponding to this parser, which the parser should understand- Throws:
Exception
-
parseOneFile
public Grid parseOneFile(Runner runner, ProjectMetadata metadata, ImportingJob job, ImportingFileRecord fileRecord, long limit, com.fasterxml.jackson.databind.node.ObjectNode options, MultiFileReadingProgress progress) throws Exception
- Throws:
Exception
-
-