Migrate pc-axis extension importers to Jackson
This commit is contained in:
parent
5b153dcfba
commit
ff57ff172e
@ -37,15 +37,16 @@ import java.io.LineNumberReader;
|
|||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import com.google.refine.importers.TabularImportingParserBase;
|
import com.google.refine.importers.TabularImportingParserBase;
|
||||||
import com.google.refine.importing.ImportingJob;
|
import com.google.refine.importing.ImportingJob;
|
||||||
import com.google.refine.model.Project;
|
import com.google.refine.model.Project;
|
||||||
import com.google.refine.model.metadata.ProjectMetadata;
|
import com.google.refine.model.metadata.ProjectMetadata;
|
||||||
import com.google.refine.util.JSONUtilities;
|
import com.google.refine.util.JSONUtilities;
|
||||||
|
import com.google.refine.util.ParsingUtilities;
|
||||||
|
|
||||||
public class PCAxisImporter extends TabularImportingParserBase {
|
public class PCAxisImporter extends TabularImportingParserBase {
|
||||||
static final Logger logger = LoggerFactory.getLogger(PCAxisImporter.class);
|
static final Logger logger = LoggerFactory.getLogger(PCAxisImporter.class);
|
||||||
@ -55,9 +56,9 @@ public class PCAxisImporter extends TabularImportingParserBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject createParserUIInitializationData(
|
public ObjectNode createParserUIInitializationData(
|
||||||
ImportingJob job, List<JSONObject> fileRecords, String format) {
|
ImportingJob job, List<ObjectNode> fileRecords, String format) {
|
||||||
JSONObject options = new JSONObject();
|
ObjectNode options = ParsingUtilities.mapper.createObjectNode();
|
||||||
JSONUtilities.safePut(options, "includeFileSources", fileRecords.size() > 1);
|
JSONUtilities.safePut(options, "includeFileSources", fileRecords.size() > 1);
|
||||||
JSONUtilities.safePut(options, "skipDataLines", 0);
|
JSONUtilities.safePut(options, "skipDataLines", 0);
|
||||||
JSONUtilities.safePut(options, "limit", -1);
|
JSONUtilities.safePut(options, "limit", -1);
|
||||||
@ -72,7 +73,7 @@ public class PCAxisImporter extends TabularImportingParserBase {
|
|||||||
String fileSource,
|
String fileSource,
|
||||||
Reader reader,
|
Reader reader,
|
||||||
int limit,
|
int limit,
|
||||||
JSONObject options,
|
ObjectNode options,
|
||||||
List<Exception> exceptions
|
List<Exception> exceptions
|
||||||
) {
|
) {
|
||||||
LineNumberReader lnReader = new LineNumberReader(reader);
|
LineNumberReader lnReader = new LineNumberReader(reader);
|
||||||
|
Loading…
Reference in New Issue
Block a user