Examples of writeValue()


Examples of com.alibaba.fastjson.JSONWriter.writeValue()

        StringWriter out = new StringWriter();

        JSONWriter writer = new JSONWriter(out);
        writer.writeStartObject();
        writer.writeKey("id");
        writer.writeValue(33);
        writer.writeEndObject();
        writer.flush();

        Assert.assertEquals("{\"id\":33}", out.toString());
    }
View Full Code Here

Examples of com.badlogic.gdx.utils.Json.writeValue()

      }

      public void write (Json json, Object object, Class valueType) {
        for (Entry<String, ?> entry : map.entries()) {
          if (entry.value.equals(object)) {
            json.writeValue(entry.key);
            return;
          }
        }
        throw new SerializationException(object.getClass().getSimpleName() + " not found: " + object);
      }
View Full Code Here

Examples of com.espertech.esper.event.bean.BeanEventPropertyWriter.writeValue()

            beanToSend = beanClass.newInstance();

            for (Map.Entry<String, Object> entry : mapToSend.entrySet()) {
                BeanEventPropertyWriter writer = writers.get(entry.getKey());
                if (writer != null) {
                    writer.writeValue(entry.getValue(), beanToSend);
                }
            }
        }
        catch (Exception e) {
            throw new EPException("Cannot populate bean instance", e);
View Full Code Here

Examples of com.eviware.soapui.support.JsonPathFacade.writeValue()

            getTargetProperty().setValue(stringValue);
        } else {
            String targetPath = PropertyExpander.expandProperties(context, getTargetPath());
            if (getTargetPathLanguage() == PathLanguage.JSONPATH) {
                JsonPathFacade jsonPathFacade = new JsonPathFacade(getTargetProperty().getValue());
                jsonPathFacade.writeValue(targetPath, value);
                getTargetProperty().setValue(jsonPathFacade.getCurrentJson());
            } else {
                XmlObject targetXml = XmlObject.Factory.parse(getTargetProperty().getValue());
                XmlCursor targetCursor = targetXml.newCursor();
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.writeValue()

        vo.values.put("key2", 2000l);
        vo.vo2.name = "testvoname2";
        vo.pods="abcde";

        try {
            mapper.writeValue(writer, vo);
        } catch (JsonGenerationException e) {
            e.printStackTrace();
        } catch (JsonMappingException e) {
            e.printStackTrace();
        } catch (IOException e) {
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectWriter.writeValue()

                {
                  @Override
                  public void write(OutputStream outputStream) throws IOException, WebApplicationException
                  {
                    // json serializer will always close the yielder
                    jsonWriter.writeValue(outputStream, yielder);
                    outputStream.close();
                  }
                },
                isSmile ? APPLICATION_JSON : APPLICATION_SMILE
            )
View Full Code Here

Examples of com.fasterxml.jackson.dataformat.xml.XmlMapper.writeValue()

    // [Issue#6], missing overrides for File-backed generator
    public void testWriteToFile() throws Exception
    {
        ObjectMapper mapper = new XmlMapper();
        File f = File.createTempFile("test", ".tst");
        mapper.writeValue(f, new IntWrapper(42));

        String xml = readAll(f).trim();

        assertEquals("<IntWrapper><i>42</i></IntWrapper>", xml);
        f.delete();
View Full Code Here

Examples of com.fasterxml.jackson.xml.XmlMapper.writeValue()

   
    XmlMapper mapper = new XmlMapper();
    mapper.configure(Feature.AUTO_CLOSE_TARGET, false);
    mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
    mapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true);
    mapper.writeValue(response.getOutputStream(), filterModel(model));
  }

}
View Full Code Here

Examples of edu.cmu.graphchi.datablocks.DataBlockManager.writeValue()

            while (iter.hasNext()) {
                int j = iter.next();
                ChiPointer ptr = vertexData.getVertexValuePtr(j, blockId);
                VertexDataType oldValue = blockManager.dereference(ptr, conv);
                VertexDataType newValue = callback.map(j, oldValue);
                blockManager.writeValue(ptr, conv, newValue);
            }
            vertexData.releaseAndCommit(i, blockId);
        }

    }
View Full Code Here

Examples of javax.rmi.CORBA.ValueHandlerMultiFormat.writeValue()

        } else
            end_flag--;

        if (valueHandler instanceof ValueHandlerMultiFormat) {
            ValueHandlerMultiFormat vh = (ValueHandlerMultiFormat)valueHandler;
            vh.writeValue(parent, array, streamFormatVersion);
        } else
            valueHandler.writeValue(parent, array);

        if (mustChunk)
            end_block();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.