Package com.fasterxml.jackson.databind.node

Examples of com.fasterxml.jackson.databind.node.ObjectNode


      System.out.println("\n"+indent+"\tDefinitions:") ;
      this.dumpMap(indent, this.definitions);
    }

    private ObjectNode getMapAsJSON(Map<String,String> map) {
      ObjectNode i18nJson = mapper.createObjectNode();
      for(String language_code: map.keySet()) {
        i18nJson.put(language_code,map.get(language_code));
      }
      return i18nJson ;
    }
View Full Code Here


    protected void readObject() {
        //until we support JSON stream processing only do this when the entire response is read
        if (done) {
            String data = getDataAsString();
            try {
                ObjectNode meta = (ObjectNode) DataSiftClient.MAPPER.readTree(data);
                ArrayNode interactions = (ArrayNode) meta.get("interactions");
                for (JsonNode interaction : interactions) {
                    send(new Interaction(interaction));
                }
                buffer.discardReadBytes();
            } catch (IOException e) {
View Full Code Here

    protected void readLineByLine() {
        String line;
        try {
            while ((line = data.readLine()) != null) {
                //System.out.println(line);
                ObjectNode interaction = (ObjectNode) DataSiftClient.MAPPER.readTree(line);
                send(new Interaction(interaction));
            }
            buffer.discardReadBytes();
        } catch (IOException e) {
            log.info("Failed to decode interaction ", e);
View Full Code Here

    @Override
    public JsonNode getSchema(SerializerProvider provider, Type typeHint)
            throws JsonMappingException
    {
        ObjectNode o = createSchemaNode("object", true);
        o.put("name", createSchemaNode("string"));
        o.put("namespace", createSchemaNode("string", true));
        o.put("attributes", createSchemaNode("array", true));
        o.put("children", createSchemaNode("array", true));
        return o;
    }
View Full Code Here

    }

    @Override
    public JsonNode getSchema(SerializerProvider provider, Type typeHint)
    {
        ObjectNode o = createSchemaNode("array", true);
        ObjectNode itemSchema = createSchemaNode("string"); //binary values written as strings?
        o.put("items", itemSchema);
        return o;
    }
View Full Code Here

  public int waitContainer(String containerId) throws DockerException, NotFoundException {
    WebResource webResource = client.resource(restEndpointUrl + String.format("/containers/%s/wait", containerId));

    try {
      LOGGER.trace("POST: {}", webResource);
      ObjectNode ObjectNode = webResource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).post(ObjectNode.class);
            return ObjectNode.get("StatusCode").asInt();
    } catch (UniformInterfaceException exception) {
      if (exception.getResponse().getStatus() == 404) {
        throw new NotFoundException(String.format("No such container %s", containerId));
      } else if (exception.getResponse().getStatus() == 500) {
        throw new DockerException("Server error", exception);
View Full Code Here

    WebResource webResource = client.resource(restEndpointUrl + "/commit").queryParams(params);

    try {
      LOGGER.trace("POST: {}", webResource);
      ObjectNode ObjectNode = webResource.accept("application/vnd.docker.raw-stream").post(ObjectNode.class, params);
            return ObjectNode.get("Id").asText();
    } catch (UniformInterfaceException exception) {
      if (exception.getResponse().getStatus() == 404) {
        throw new NotFoundException(String.format("No such container %s", commitConfig.getContainer()));
      } else if (exception.getResponse().getStatus() == 500) {
        throw new DockerException("Server error", exception);
View Full Code Here

    @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;
View Full Code Here

     */
    @Override
    public JsonNode getSchema(SerializerProvider provider, Type typeHint, boolean isOptional)
        throws JsonMappingException
    {
      ObjectNode schema = (ObjectNode) getSchema(provider, typeHint);
      if (!isOptional) {
        schema.put("required", !isOptional);
      }
        return schema;
    }
View Full Code Here

        return JsonNodeFactory.instance.objectNode();
    }
   
    protected ObjectNode createSchemaNode(String type)
    {
        ObjectNode schema = createObjectNode();
        schema.put("type", type);
        return schema;
    }
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.databind.node.ObjectNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.