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.changes.CellChange;
|
||||
import com.google.refine.operations.EngineDependentMassCellOperation;
|
||||
import com.google.refine.util.ParsingUtilities;
|
||||
|
||||
public class BlankDownOperation extends EngineDependentMassCellOperation {
|
||||
|
||||
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
||||
JSONObject engineConfig = obj.getJSONObject("engineConfig");
|
||||
|
||||
return new BlankDownOperation(
|
||||
EngineConfig.reconstruct(engineConfig),
|
||||
obj.getString("columnName")
|
||||
);
|
||||
return ParsingUtilities.mapper.readValue(obj.toString(), BlankDownOperation.class);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
|
@ -52,16 +52,12 @@ import com.google.refine.model.Project;
|
||||
import com.google.refine.model.Row;
|
||||
import com.google.refine.model.changes.CellChange;
|
||||
import com.google.refine.operations.EngineDependentMassCellOperation;
|
||||
import com.google.refine.util.ParsingUtilities;
|
||||
|
||||
public class FillDownOperation extends EngineDependentMassCellOperation {
|
||||
|
||||
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
||||
JSONObject engineConfig = obj.getJSONObject("engineConfig");
|
||||
|
||||
return new FillDownOperation(
|
||||
EngineConfig.reconstruct(engineConfig),
|
||||
obj.getString("columnName")
|
||||
);
|
||||
return ParsingUtilities.mapper.readValue(obj.toString(), FillDownOperation.class);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
|
@ -38,6 +38,7 @@ import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
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.Row;
|
||||
import com.google.refine.model.changes.MassRowChange;
|
||||
import com.google.refine.util.ParsingUtilities;
|
||||
|
||||
public class MultiValuedCellJoinOperation extends AbstractOperation {
|
||||
final protected String _columnName;
|
||||
@ -55,16 +57,16 @@ public class MultiValuedCellJoinOperation extends AbstractOperation {
|
||||
final protected String _separator;
|
||||
|
||||
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
||||
return new MultiValuedCellJoinOperation(
|
||||
obj.getString("columnName"),
|
||||
obj.getString("keyColumnName"),
|
||||
obj.getString("separator")
|
||||
);
|
||||
return ParsingUtilities.mapper.readValue(obj.toString(), MultiValuedCellJoinOperation.class);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public MultiValuedCellJoinOperation(
|
||||
@JsonProperty("columnName")
|
||||
String columnName,
|
||||
@JsonProperty("keyColumnName")
|
||||
String keyColumnName,
|
||||
@JsonProperty("separator")
|
||||
String separator
|
||||
) {
|
||||
_columnName = columnName;
|
||||
|
Loading…
Reference in New Issue
Block a user