Jackson deserialization for MultiValuedCellJoinOperation
This commit is contained in:
parent
379a12d349
commit
0cf8c2dd04
@ -51,16 +51,12 @@ import com.google.refine.model.Project;
|
|||||||
import com.google.refine.model.Row;
|
import com.google.refine.model.Row;
|
||||||
import com.google.refine.model.changes.CellChange;
|
import com.google.refine.model.changes.CellChange;
|
||||||
import com.google.refine.operations.EngineDependentMassCellOperation;
|
import com.google.refine.operations.EngineDependentMassCellOperation;
|
||||||
|
import com.google.refine.util.ParsingUtilities;
|
||||||
|
|
||||||
public class BlankDownOperation extends EngineDependentMassCellOperation {
|
public class BlankDownOperation extends EngineDependentMassCellOperation {
|
||||||
|
|
||||||
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
||||||
JSONObject engineConfig = obj.getJSONObject("engineConfig");
|
return ParsingUtilities.mapper.readValue(obj.toString(), BlankDownOperation.class);
|
||||||
|
|
||||||
return new BlankDownOperation(
|
|
||||||
EngineConfig.reconstruct(engineConfig),
|
|
||||||
obj.getString("columnName")
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
|
@ -52,16 +52,12 @@ import com.google.refine.model.Project;
|
|||||||
import com.google.refine.model.Row;
|
import com.google.refine.model.Row;
|
||||||
import com.google.refine.model.changes.CellChange;
|
import com.google.refine.model.changes.CellChange;
|
||||||
import com.google.refine.operations.EngineDependentMassCellOperation;
|
import com.google.refine.operations.EngineDependentMassCellOperation;
|
||||||
|
import com.google.refine.util.ParsingUtilities;
|
||||||
|
|
||||||
public class FillDownOperation extends EngineDependentMassCellOperation {
|
public class FillDownOperation extends EngineDependentMassCellOperation {
|
||||||
|
|
||||||
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
||||||
JSONObject engineConfig = obj.getJSONObject("engineConfig");
|
return ParsingUtilities.mapper.readValue(obj.toString(), FillDownOperation.class);
|
||||||
|
|
||||||
return new FillDownOperation(
|
|
||||||
EngineConfig.reconstruct(engineConfig),
|
|
||||||
obj.getString("columnName")
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
|
@ -38,6 +38,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
import com.google.refine.expr.ExpressionUtils;
|
import com.google.refine.expr.ExpressionUtils;
|
||||||
@ -48,6 +49,7 @@ import com.google.refine.model.Column;
|
|||||||
import com.google.refine.model.Project;
|
import com.google.refine.model.Project;
|
||||||
import com.google.refine.model.Row;
|
import com.google.refine.model.Row;
|
||||||
import com.google.refine.model.changes.MassRowChange;
|
import com.google.refine.model.changes.MassRowChange;
|
||||||
|
import com.google.refine.util.ParsingUtilities;
|
||||||
|
|
||||||
public class MultiValuedCellJoinOperation extends AbstractOperation {
|
public class MultiValuedCellJoinOperation extends AbstractOperation {
|
||||||
final protected String _columnName;
|
final protected String _columnName;
|
||||||
@ -55,16 +57,16 @@ public class MultiValuedCellJoinOperation extends AbstractOperation {
|
|||||||
final protected String _separator;
|
final protected String _separator;
|
||||||
|
|
||||||
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
||||||
return new MultiValuedCellJoinOperation(
|
return ParsingUtilities.mapper.readValue(obj.toString(), MultiValuedCellJoinOperation.class);
|
||||||
obj.getString("columnName"),
|
|
||||||
obj.getString("keyColumnName"),
|
|
||||||
obj.getString("separator")
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonCreator
|
||||||
public MultiValuedCellJoinOperation(
|
public MultiValuedCellJoinOperation(
|
||||||
|
@JsonProperty("columnName")
|
||||||
String columnName,
|
String columnName,
|
||||||
|
@JsonProperty("keyColumnName")
|
||||||
String keyColumnName,
|
String keyColumnName,
|
||||||
|
@JsonProperty("separator")
|
||||||
String separator
|
String separator
|
||||||
) {
|
) {
|
||||||
_columnName = columnName;
|
_columnName = columnName;
|
||||||
|
Loading…
Reference in New Issue
Block a user