diff --git a/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java b/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java index a5455397f..97f886074 100644 --- a/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java +++ b/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java @@ -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.history.HistoryEntry; @@ -47,20 +48,21 @@ import com.google.refine.model.Column; import com.google.refine.model.Project; import com.google.refine.model.Row; import com.google.refine.model.changes.MassRowColumnChange; +import com.google.refine.util.ParsingUtilities; public class TransposeRowsIntoColumnsOperation extends AbstractOperation { final protected String _columnName; final protected int _rowCount; static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception { - return new TransposeRowsIntoColumnsOperation( - obj.getString("columnName"), - obj.getInt("rowCount") - ); + return ParsingUtilities.mapper.readValue(obj.toString(), TransposeRowsIntoColumnsOperation.class); } + @JsonCreator public TransposeRowsIntoColumnsOperation( + @JsonProperty("columnName") String columnName, + @JsonProperty("rowCount") int rowCount ) { _columnName = columnName;