use of com.google.refine.model.Column in project OpenRefine by OpenRefine.
the class Criterion method initializeFromJSON.
public void initializeFromJSON(Project project, JSONObject obj) throws JSONException {
if (obj.has("column") && !obj.isNull("column")) {
columnName = obj.getString("column");
Column column = project.columnModel.getColumnByName(columnName);
cellIndex = column != null ? column.getCellIndex() : -1;
}
if (obj.has("blankPosition") && !obj.isNull("blankPosition")) {
blankPosition = obj.getInt("blankPosition");
}
if (obj.has("errorPosition") && !obj.isNull("errorPosition")) {
errorPosition = obj.getInt("errorPosition");
}
if (obj.has("reverse") && !obj.isNull("reverse")) {
reverse = obj.getBoolean("reverse");
}
}
use of com.google.refine.model.Column in project OpenRefine by OpenRefine.
the class UrlFetchingTests method SetUp.
@BeforeMethod
public void SetUp() throws JSONException, IOException, ModelException {
File dir = TestUtils.createTempDirectory("openrefine-test-workspace-dir");
FileProjectManager.initialize(dir);
project = new Project();
ProjectMetadata pm = new ProjectMetadata();
pm.setName("URL Fetching Test Project");
ProjectManager.singleton.registerProject(project, pm);
int index = project.columnModel.allocateNewCellIndex();
Column column = new Column(index, "fruits");
project.columnModel.addColumn(index, column, true);
options = mock(Properties.class);
engine = new Engine(project);
engine_config = new JSONObject(ENGINE_JSON_URLS);
engine.initializeFromJSON(engine_config);
engine.setMode(Engine.Mode.RowBased);
bindings = new Properties();
bindings.put("project", project);
}
Aggregations