Disable Jackson autodetect and annotate remaining classes
This commit is contained in:
parent
bb0b351cef
commit
b6a724b429
@ -39,6 +39,8 @@ import java.util.Properties;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONWriter;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import com.google.refine.Jsonizable;
|
||||
|
||||
/**
|
||||
@ -50,6 +52,7 @@ import com.google.refine.Jsonizable;
|
||||
public class EvalError implements Serializable, Jsonizable {
|
||||
private static final long serialVersionUID = -102681220092874080L;
|
||||
|
||||
@JsonProperty("message")
|
||||
final public String message;
|
||||
|
||||
public EvalError(String message) {
|
||||
@ -75,5 +78,10 @@ public class EvalError implements Serializable, Jsonizable {
|
||||
writer.key("message"); writer.value(message);
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
@JsonProperty("type")
|
||||
public String getType() {
|
||||
return "error";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.json.JSONWriter;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import com.google.refine.Jsonizable;
|
||||
import com.google.refine.expr.ExpressionUtils;
|
||||
import com.google.refine.model.Recon.Judgment;
|
||||
@ -53,8 +55,11 @@ public class ReconStats implements Jsonizable {
|
||||
);
|
||||
}
|
||||
|
||||
@JsonProperty("nonBlanks")
|
||||
final public int nonBlanks;
|
||||
@JsonProperty("newTopics")
|
||||
final public int newTopics;
|
||||
@JsonProperty("matchedTopics")
|
||||
final public int matchedTopics;
|
||||
|
||||
public ReconStats(int nonBlanks, int newTopics, int matchedTopics) {
|
||||
|
@ -39,6 +39,8 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.json.JSONWriter;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import com.google.refine.Jsonizable;
|
||||
|
||||
/**
|
||||
@ -47,7 +49,9 @@ import com.google.refine.Jsonizable;
|
||||
* store the (expected) types of new columns.
|
||||
*/
|
||||
public class ReconType implements Jsonizable {
|
||||
@JsonProperty("id")
|
||||
public String id;
|
||||
@JsonProperty("name")
|
||||
public String name;
|
||||
|
||||
public ReconType(String id, String name) {
|
||||
|
@ -59,6 +59,9 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.json.JSONTokener;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ObjectWriter;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
@ -74,6 +77,8 @@ public class ParsingUtilities {
|
||||
module.addSerializer(double.class, new SerializationFilters.DoubleSerializer());
|
||||
module.addSerializer(OffsetDateTime.class, new SerializationFilters.DateSerializer());
|
||||
mapper.registerModule(module);
|
||||
mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE);
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
}
|
||||
|
||||
public static final FilterProvider defaultFilters = new SimpleFilterProvider()
|
||||
|
Loading…
Reference in New Issue
Block a user