Package com.google.refine.importers
Class ImportingParserBase
java.lang.Object
com.google.refine.importers.ImportingParserBase
- All Implemented Interfaces:
ImportingParser
- Direct Known Subclasses:
RdfTripleImporter,TabularImportingParserBase,TreeImportingParserBase
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static intaddArchiveColumn(Project project) protected static intaddFilenameColumn(Project project, boolean archiveColumnAdded) Deprecated.2020-07-21 by tfmorris.com.fasterxml.jackson.databind.node.ObjectNodecreateParserUIInitializationData(ImportingJob job, List<com.fasterxml.jackson.databind.node.ObjectNode> fileRecords, String format) Create data sufficient for the parser UI on the client side to do its work.voidparse(Project project, ProjectMetadata metadata, ImportingJob job, List<com.fasterxml.jackson.databind.node.ObjectNode> fileRecords, String format, int limit, com.fasterxml.jackson.databind.node.ObjectNode options, List<Exception> exceptions) voidparseOneFile(Project project, ProjectMetadata metadata, ImportingJob job, com.fasterxml.jackson.databind.node.ObjectNode fileRecord, int limit, com.fasterxml.jackson.databind.node.ObjectNode options, List<Exception> exceptions, ImporterUtilities.MultiFileReadingProgress progress) voidparseOneFile(Project project, ProjectMetadata metadata, ImportingJob job, String fileSource, InputStream inputStream, int limit, com.fasterxml.jackson.databind.node.ObjectNode options, List<Exception> exceptions) voidparseOneFile(Project project, ProjectMetadata metadata, ImportingJob job, String fileSource, Reader reader, int limit, com.fasterxml.jackson.databind.node.ObjectNode options, List<Exception> exceptions) Parsing method to be implemented by Reader-based parsers.
-
Field Details
-
useInputStream
protected final boolean useInputStream
-
-
Constructor Details
-
ImportingParserBase
protected ImportingParserBase(boolean useInputStream) - Parameters:
useInputStream- true if parser takes an InputStream, false if it takes a Reader.
-
-
Method Details
-
createParserUIInitializationData
public com.fasterxml.jackson.databind.node.ObjectNode createParserUIInitializationData(ImportingJob job, List<com.fasterxml.jackson.databind.node.ObjectNode> fileRecords, String format) Description copied from interface:ImportingParserCreate 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:
createParserUIInitializationDatain interfaceImportingParser- Returns:
- ObjectNode options
-
parse
public void parse(Project project, ProjectMetadata metadata, ImportingJob job, List<com.fasterxml.jackson.databind.node.ObjectNode> fileRecords, String format, int limit, com.fasterxml.jackson.databind.node.ObjectNode options, List<Exception> exceptions) - Specified by:
parsein interfaceImportingParserlimit- maximum number of rows to createoptions- custom options put together by the UI corresponding to this parser, which the parser should understandexceptions- list of exceptions thrown during the parse. Expects an empty List as input to which it can append new Exceptions thrown
-
parseOneFile
public void parseOneFile(Project project, ProjectMetadata metadata, ImportingJob job, com.fasterxml.jackson.databind.node.ObjectNode fileRecord, int limit, com.fasterxml.jackson.databind.node.ObjectNode options, List<Exception> exceptions, ImporterUtilities.MultiFileReadingProgress progress) throws IOException - Throws:
IOException
-
parseOneFile
public void parseOneFile(Project project, ProjectMetadata metadata, ImportingJob job, String fileSource, Reader reader, int limit, com.fasterxml.jackson.databind.node.ObjectNode options, List<Exception> exceptions) Parsing method to be implemented by Reader-based parsers. ie those initialized with useInputStream == false- Parameters:
project-metadata-job-fileSource-reader-limit-options-exceptions-
-
parseOneFile
public void parseOneFile(Project project, ProjectMetadata metadata, ImportingJob job, String fileSource, InputStream inputStream, int limit, com.fasterxml.jackson.databind.node.ObjectNode options, List<Exception> exceptions) -
addFilenameColumn
Deprecated.2020-07-21 by tfmorris. This will become private in a future release. -
addArchiveColumn
-