Package org.exoplatform.ws.frameworks.json

Examples of org.exoplatform.ws.frameworks.json.JsonWriter


      // Create JSON to WorkspaceEntry
      JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
      JsonValue json = generatorImpl.createJsonObject(wEntry);
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      JsonWriter jsonWriter = new JsonWriterImpl(out);
      json.writeTo(jsonWriter);
      jsonWriter.flush();
      jsonWriter.close();

      // Create WorkspaceEntry from JSON
      ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
      JsonParser jsonParser = new JsonParserImpl();
      JsonHandler jsonHandler = new JsonDefaultHandler();
View Full Code Here


      MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException
   {
      try
      {
         JsonValue jv = new JsonGeneratorImpl().createJsonObject(t);
         JsonWriter jsonWriter = new JsonWriterImpl(entityStream);
         jv.writeTo(jsonWriter);
         jsonWriter.flush();
      }
      catch (JsonException e)
      {
         throw new IOException("Can't write to output stream " + e);
      }
View Full Code Here

      MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException
   {
      try
      {
         JsonValue jv = new JsonGeneratorImpl().createJsonObject(t);
         JsonWriter jsonWriter = new JsonWriterImpl(entityStream);
         jv.writeTo(jsonWriter);
         jsonWriter.flush();
      }
      catch (JsonException e)
      {
         throw new IOException("Can't write to output stream " + e);
      }
View Full Code Here

      book.setPages(pages);
      book.setPrice(price);
      book.setIsdn(isdn);

      JsonValue jv = new JsonGeneratorImpl().createJsonObject(book);
      JsonWriter jsonWriter = new JsonWriterImpl(out);
      jv.writeTo(jsonWriter);
      jsonWriter.flush();
      jsonWriter.close();

      ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
      JsonParser jsonParser = new JsonParserImpl();
      JsonHandler jsonHandler = new JsonDefaultHandler();
View Full Code Here

TOP

Related Classes of org.exoplatform.ws.frameworks.json.JsonWriter

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.