@Test public void parseColumnNames() throws IOException { final InputStream inputStream = DatasetImporterForMetaTable.class.getResourceAsStream("test-meta-globi.json"); final JsonNode config = new ObjectMapper().readTree(inputStream); List<DatasetImporterForMetaTable.Column> columnNames = DatasetImporterForMetaTable.columnNamesForMetaTable(config); assertThat(columnNames.size(), is(40)); assertThat(columnNames.get(0).getDefaultValue(), is("some default interaction name")); assertThat(columnNames.get(1).getDefaultValue(), is(nullValue())); }
public static List<Column> columnNamesForMetaTable(JsonNode config) { List<Column> columnNames = new ArrayList<Column>(); final JsonNode tableSchema = config.get("tableSchema"); if (tableSchema != null) { columnNames = columnNamesForSchema(tableSchema); } return columnNames; }
DatasetImporterForMetaTable extends DatasetImporterWithListener { public static List<Column> columnNamesForMetaTable(JsonNode config) { List<Column> columnNames = new ArrayList<Column>(); final JsonNode tableSchema = config.get("tableSchema"); if (tableSchema != null) { columnNames = columnNamesForSchema(tableSchema); } return columnNames; } }
DatasetImporterForMetaTable extends DatasetImporterWithListener { public static List<Column> columnNamesForMetaTable(JsonNode config) { List<Column> columnNames = new ArrayList<Column>(); final JsonNode tableSchema = config.get("tableSchema"); if (tableSchema != null) { columnNames = columnNamesForSchema(tableSchema); } return columnNames; } DatasetImporterForMetaTable(ParserFactory parserFactory, NodeFactory nodeFactory); }
DatasetImporterForMetaTable extends DatasetImporterWithListener { public static List<Column> columnNamesForMetaTable(JsonNode config) { List<Column> columnNames = new ArrayList<Column>(); final JsonNode tableSchema = config.get("tableSchema"); if (tableSchema != null) { columnNames = columnNamesForSchema(tableSchema); } return columnNames; } DatasetImporterForMetaTable(ParserFactory parserFactory, NodeFactory nodeFactory); @Override void importStudy(); static void append(StringBuilder citation, String value, String suffix, String prefix); static void append(StringBuilder citation, String value, String continuation); static InteractType generateInteractionType(Map<String, String> properties, InteractTypeMapper mapper); JsonNode getConfig(); String getBaseUrl(); static void importAll(InteractionListener interactionListener,
                                 List<Column> columnNames,
                                 CSVParse csvParse, JsonNode config, ImportLogger importLogger); static void parseColumnValue(ImportLogger importLogger, Map<String, String> mappedLine, String value, Column column); static void logParseWarning(ImportLogger importLogger, Map<String, String> mappedLine, String value, Column column); static String valueOrDefault(String value, Column column); static void setInteractionType(Map<String, String> properties, InteractType type); static String parseValue(String value, Column column); void setDataset(Dataset dataset); Dataset getDataset(); static List<Column> columnNamesForMetaTable(JsonNode config); static List<Column> columnNamesForSchema(JsonNode tableSchema); static Column createStringColumn(JsonNode columnName); }
DatasetImporterForMetaTable extends DatasetImporterWithListener { public static List<Column> columnNamesForMetaTable(JsonNode config) { List<Column> columnNames = new ArrayList<Column>(); final JsonNode tableSchema = config.get("tableSchema"); if (tableSchema != null) { columnNames = columnNamesForSchema(tableSchema); } return columnNames; } DatasetImporterForMetaTable(ParserFactory parserFactory, NodeFactory nodeFactory); @Override void importStudy(); static void append(StringBuilder citation, String value, String suffix, String prefix); static void append(StringBuilder citation, String value, String continuation); static InteractType generateInteractionType(Map<String, String> properties, InteractTypeMapper mapper); JsonNode getConfig(); String getBaseUrl(); static void importAll(InteractionListener interactionListener,
                                 List<Column> columnNames,
                                 CSVParse csvParse, JsonNode config, ImportLogger importLogger); static void parseColumnValue(ImportLogger importLogger, Map<String, String> mappedLine, String value, Column column); static void logParseWarning(ImportLogger importLogger, Map<String, String> mappedLine, String value, Column column); static String valueOrDefault(String value, Column column); static void setInteractionType(Map<String, String> properties, InteractType type); static String parseValue(String value, Column column); void setDataset(Dataset dataset); Dataset getDataset(); static List<Column> columnNamesForMetaTable(JsonNode config); static List<Column> columnNamesForSchema(JsonNode tableSchema); static Column createStringColumn(JsonNode columnName); static final String AUTHOR; static final String TITLE; static final String YEAR; static final String JOURNAL; static final String VOLUME; static final String NUMBER; static final String PAGES; static final String LONGITUDE; static final String LATITUDE; static final String EVENT_DATE; }