Search in sources :

Example 86 with ObjectNode

use of com.fasterxml.jackson.databind.node.ObjectNode in project Rosetta by HubSpot.

the class StoredAsJsonTest method testAnnotatedSetterWithDefaultDeserialization.

@Test
public void testAnnotatedSetterWithDefaultDeserialization() throws JsonProcessingException {
    ObjectNode node = Rosetta.getMapper().createObjectNode();
    node.put("annotatedSetterWithDefault", expected);
    StoredAsJsonBean bean = Rosetta.getMapper().treeToValue(node, StoredAsJsonBean.class);
    assertThat(bean.getAnnotatedSetterWithDefault().getStringProperty()).isEqualTo("value");
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) StoredAsJsonBean(com.hubspot.rosetta.beans.StoredAsJsonBean) Test(org.junit.Test)

Example 87 with ObjectNode

use of com.fasterxml.jackson.databind.node.ObjectNode in project Rosetta by HubSpot.

the class StoredAsJsonTest method testAnnotatedSetterWithDefaultNullDeserialization.

@Test
public void testAnnotatedSetterWithDefaultNullDeserialization() throws JsonProcessingException {
    ObjectNode node = Rosetta.getMapper().createObjectNode();
    node.put("annotatedSetterWithDefault", NullNode.getInstance());
    StoredAsJsonBean bean = Rosetta.getMapper().treeToValue(node, StoredAsJsonBean.class);
    assertThat(bean.getAnnotatedSetterWithDefault().getStringProperty()).isEqualTo("value");
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) StoredAsJsonBean(com.hubspot.rosetta.beans.StoredAsJsonBean) Test(org.junit.Test)

Example 88 with ObjectNode

use of com.fasterxml.jackson.databind.node.ObjectNode in project series-rest-api by 52North.

the class GeoJSONEncoder method encode.

protected ObjectNode encode(Point geometry, int parentSrid) {
    ObjectNode json = jsonFactory.objectNode();
    json.put(JSONConstants.TYPE, JSONConstants.POINT);
    json.set(JSONConstants.COORDINATES, encodeCoordinates(geometry));
    encodeCRS(json, geometry, parentSrid);
    return json;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode)

Example 89 with ObjectNode

use of com.fasterxml.jackson.databind.node.ObjectNode in project series-rest-api by 52North.

the class GeoJSONEncoder method encode.

protected ObjectNode encode(MultiPolygon geometry, int parentSrid) {
    ObjectNode json = jsonFactory.objectNode();
    ArrayNode list = json.put(JSONConstants.TYPE, JSONConstants.MULTI_POLYGON).putArray(JSONConstants.COORDINATES);
    for (int i = 0; i < geometry.getNumGeometries(); ++i) {
        list.add(encodeCoordinates((Polygon) geometry.getGeometryN(i)));
    }
    encodeCRS(json, geometry, parentSrid);
    return json;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) MultiPolygon(com.vividsolutions.jts.geom.MultiPolygon) Polygon(com.vividsolutions.jts.geom.Polygon) Point(com.vividsolutions.jts.geom.Point) MultiPoint(com.vividsolutions.jts.geom.MultiPoint)

Example 90 with ObjectNode

use of com.fasterxml.jackson.databind.node.ObjectNode in project series-rest-api by 52North.

the class GeoJSONEncoder method encode.

protected ObjectNode encode(Polygon geometry, int parentSrid) {
    ObjectNode json = jsonFactory.objectNode();
    json.put(JSONConstants.TYPE, JSONConstants.POLYGON);
    json.set(JSONConstants.COORDINATES, encodeCoordinates(geometry));
    encodeCRS(json, geometry, parentSrid);
    return json;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode)

Aggregations

ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)769 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)185 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)167 JsonNode (com.fasterxml.jackson.databind.JsonNode)165 Test (org.junit.Test)112 StringEntity (org.apache.http.entity.StringEntity)88 Deployment (org.activiti.engine.test.Deployment)84 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)67 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)64 Task (org.activiti.engine.task.Task)49 HttpPost (org.apache.http.client.methods.HttpPost)49 JCodeModel (com.sun.codemodel.JCodeModel)45 JPackage (com.sun.codemodel.JPackage)44 IOException (java.io.IOException)44 HttpPut (org.apache.http.client.methods.HttpPut)40 JType (com.sun.codemodel.JType)39 HashMap (java.util.HashMap)39 Cluster (org.apache.geode.tools.pulse.internal.data.Cluster)39 Map (java.util.Map)33 ArrayList (java.util.ArrayList)32