Package javax.json

Examples of javax.json.JsonWriter



  public static void main(String[] args) {

    StringWriter s = new StringWriter();
    JsonWriter writer = Json.createWriter(s);
    writer.writeObject(buildJSon());
    System.out.println(s);

  }
View Full Code Here


   }

   @Override
   public void writeTo(JsonArray jsonValues, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException
   {
      JsonWriter writer = findWriter(mediaType, entityStream);
      try
      {
         writer.writeArray(jsonValues);
      }
      finally
      {
         writer.close();
      }
   }
View Full Code Here

   }

   @Override
   public void writeTo(JsonStructure jsonStructure, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException
   {
      JsonWriter writer = findWriter(mediaType, entityStream);
      try
      {
         writer.write(jsonStructure);
      }
      finally
      {
         writer.close();
      }
   }
View Full Code Here

       
        if (entityStream == null) {
            throw new IOException("Initialized OutputStream should be provided");
        }
       
        JsonWriter writer = null;
        try {
            writer = Json.createWriter(entityStream);
            writer.write(t);
        } finally {
            if (writer != null) {
                writer.close();
            }
        }
    }
View Full Code Here

TOP

Related Classes of javax.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.