Jackson deserialization for ReconOperation
This commit is contained in:
parent
08c2b8fb2b
commit
0a5ea4e3dd
@ -44,6 +44,7 @@ import org.json.JSONObject;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
|
||||||
@ -75,19 +76,17 @@ public class ReconOperation extends EngineDependentOperation {
|
|||||||
final protected String _columnName;
|
final protected String _columnName;
|
||||||
final protected ReconConfig _reconConfig;
|
final protected ReconConfig _reconConfig;
|
||||||
|
|
||||||
static public ReconOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
static public ReconOperation reconstruct(Project project, JSONObject obj) throws IOException {
|
||||||
JSONObject engineConfig = obj.getJSONObject("engineConfig");
|
return ParsingUtilities.mapper.readValue(obj.toString(), ReconOperation.class);
|
||||||
|
|
||||||
return new ReconOperation(
|
|
||||||
EngineConfig.reconstruct(engineConfig),
|
|
||||||
obj.getString("columnName"),
|
|
||||||
ReconConfig.reconstruct(obj.getJSONObject("config").toString())
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonCreator
|
||||||
public ReconOperation(
|
public ReconOperation(
|
||||||
|
@JsonProperty("engineConfig")
|
||||||
EngineConfig engineConfig,
|
EngineConfig engineConfig,
|
||||||
|
@JsonProperty("columnName")
|
||||||
String columnName,
|
String columnName,
|
||||||
|
@JsonProperty("config")
|
||||||
ReconConfig reconConfig
|
ReconConfig reconConfig
|
||||||
) {
|
) {
|
||||||
super(engineConfig);
|
super(engineConfig);
|
||||||
|
Loading…
Reference in New Issue
Block a user