Search in sources :

Example 6 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project azure-sdk-for-java by Azure.

the class DeployUsingARMTemplate method validateAndAddFieldValue.

private static void validateAndAddFieldValue(String type, String fieldValue, String fieldName, String errorMessage, JsonNode tmp) throws IllegalAccessException {
    // Add count variable for loop....
    final ObjectMapper mapper = new ObjectMapper();
    final ObjectNode parameter = mapper.createObjectNode();
    parameter.put("type", type);
    if (type == "int") {
        parameter.put("defaultValue", Integer.parseInt(fieldValue));
    } else {
        parameter.put("defaultValue", fieldValue);
    }
    ObjectNode.class.cast(tmp.get("parameters")).replace(fieldName, parameter);
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 7 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project azure-sdk-for-java by Azure.

the class DeployUsingARMTemplateWithProgress method validateAndAddFieldValue.

private static void validateAndAddFieldValue(String type, String fieldValue, String fieldName, String errorMessage, JsonNode tmp) throws IllegalAccessException {
    // Add count variable for loop....
    final ObjectMapper mapper = new ObjectMapper();
    final ObjectNode parameter = mapper.createObjectNode();
    parameter.put("type", type);
    if (type == "int") {
        parameter.put("defaultValue", Integer.parseInt(fieldValue));
    } else {
        parameter.put("defaultValue", fieldValue);
    }
    ObjectNode.class.cast(tmp.get("parameters")).replace(fieldName, parameter);
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 8 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project jackson-databind by FasterXML.

the class StdSerializer method createSchemaNode.

/*
    /**********************************************************
    /* Helper methods for JSON Schema generation
    /**********************************************************
     */
protected ObjectNode createSchemaNode(String type) {
    ObjectNode schema = JsonNodeFactory.instance.objectNode();
    schema.put("type", type);
    return schema;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode)

Example 9 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project jackson-databind by FasterXML.

the class BeanSerializerBase method getSchema.

@Deprecated
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint) throws JsonMappingException {
    ObjectNode o = createSchemaNode("object", true);
    // [JACKSON-813]: Add optional JSON Schema id attribute, if found
    // NOTE: not optimal, does NOT go through AnnotationIntrospector etc:
    JsonSerializableSchema ann = _handledType.getAnnotation(JsonSerializableSchema.class);
    if (ann != null) {
        String id = ann.id();
        if (id != null && id.length() > 0) {
            o.put("id", id);
        }
    }
    //todo: should the classname go in the title?
    //o.put("title", _className);
    ObjectNode propertiesNode = o.objectNode();
    final PropertyFilter filter;
    if (_propertyFilterId != null) {
        filter = findPropertyFilter(provider, _propertyFilterId, null);
    } else {
        filter = null;
    }
    for (int i = 0; i < _props.length; i++) {
        BeanPropertyWriter prop = _props[i];
        if (filter == null) {
            prop.depositSchemaProperty(propertiesNode, provider);
        } else {
            filter.depositSchemaProperty(prop, propertiesNode, provider);
        }
    }
    o.set("properties", propertiesNode);
    return o;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) JsonSerializableSchema(com.fasterxml.jackson.databind.jsonschema.JsonSerializableSchema)

Example 10 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project jackson-databind by FasterXML.

the class ByteArraySerializer method getSchema.

@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint) {
    ObjectNode o = createSchemaNode("array", true);
    //binary values written as strings?
    ObjectNode itemSchema = createSchemaNode("byte");
    return o.set("items", itemSchema);
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode)

Aggregations

ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2465 JsonNode (com.fasterxml.jackson.databind.JsonNode)564 Test (org.junit.Test)559 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)514 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)379 IOException (java.io.IOException)221 ArrayList (java.util.ArrayList)123 Map (java.util.Map)111 HashMap (java.util.HashMap)107 List (java.util.List)98 StringEntity (org.apache.http.entity.StringEntity)94 Deployment (org.activiti.engine.test.Deployment)85 Test (org.testng.annotations.Test)81 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)69 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)65 HttpPost (org.apache.http.client.methods.HttpPost)57 AbstractRpcLwM2MIntegrationTest (org.thingsboard.server.transport.lwm2m.rpc.AbstractRpcLwM2MIntegrationTest)54 TextNode (com.fasterxml.jackson.databind.node.TextNode)52 File (java.io.File)51 Task (org.activiti.engine.task.Task)51