Examples of JsonParserImpl


Examples of org.exoplatform.ws.frameworks.json.impl.JsonParserImpl

   public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType,
      MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException
   {
      try
      {
         JsonParserImpl parser = new JsonParserImpl();
         JsonDefaultHandler handler = new JsonDefaultHandler();

         parser.parse(entityStream, handler);
         JsonValue jsonValue = handler.getJsonObject();

         if (JsonValue.class.isAssignableFrom(type))
         {
            // If requested object is JsonValue then stop processing here.
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonParserImpl

    *           will be generated Exception
    */
   private Object getObject(Class cl, byte[] data) throws Exception
   {
      JsonHandler jsonHandler = new JsonDefaultHandler();
      JsonParser jsonParser = new JsonParserImpl();
      InputStream inputStream = new ByteArrayInputStream(data);
      jsonParser.parse(inputStream, jsonHandler);
      JsonValue jsonValue = jsonHandler.getJsonObject();

      return new BeanBuilder().createObject(cl, jsonValue);
   }
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonParserImpl

   * @throws Exception
   *           will be generated Exception
   */
  private Object getObject(Class cl, byte[] data) throws Exception {
    JsonHandler jsonHandler = new JsonDefaultHandler();
    JsonParser jsonParser = new JsonParserImpl();
    InputStream inputStream = new ByteArrayInputStream(data);
    jsonParser.parse(inputStream, jsonHandler);
    JsonValue jsonValue = jsonHandler.getJsonObject();

    return new BeanBuilder().createObject(cl, jsonValue);
  }
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonParserImpl

       *           will be generated Exception
       */
      private Object getObject(Class cl, byte[] data) throws Exception
      {
         JsonHandler jsonHandler = new JsonDefaultHandler();
         JsonParser jsonParser = new JsonParserImpl();
         InputStream inputStream = new ByteArrayInputStream(data);
         jsonParser.parse(inputStream, jsonHandler);
         JsonValue jsonValue = jsonHandler.getJsonObject();

         return new BeanBuilder().createObject(cl, jsonValue);
      }
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonParserImpl

       *           will be generated Exception
       */
      private Object getObject(Class cl, byte[] data) throws Exception
      {
         JsonHandler jsonHandler = new JsonDefaultHandler();
         JsonParser jsonParser = new JsonParserImpl();
         InputStream inputStream = new ByteArrayInputStream(data);
         jsonParser.parse(inputStream, jsonHandler);
         JsonValue jsonValue = jsonHandler.getJsonObject();

         return new BeanBuilder().createObject(cl, jsonValue);
      }
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonParserImpl

   public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType,
      MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException
   {
      try
      {
         JsonParserImpl parser = new JsonParserImpl();
         JsonDefaultHandler handler = new JsonDefaultHandler();

         parser.parse(entityStream, handler);
         JsonValue jsonValue = handler.getJsonObject();

         if (JsonValue.class.isAssignableFrom(type))
         {
            // If requested object is JsonValue then stop processing here.
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonParserImpl

    *           will be generated Exception
    */
   private Object getObject(Class cl, byte[] data) throws Exception
   {
      JsonHandler jsonHandler = new JsonDefaultHandler();
      JsonParser jsonParser = new JsonParserImpl();
      InputStream inputStream = new ByteArrayInputStream(data);
      jsonParser.parse(inputStream, jsonHandler);
      JsonValue jsonValue = jsonHandler.getJsonObject();

      return new BeanBuilder().createObject(cl, jsonValue);
   }
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonParserImpl

      jsonWriter.flush();
      jsonWriter.close();

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

      jsonParser.parse(in, jsonHandler);
      JsonValue jsonValue = jsonHandler.getJsonObject();

      WorkspaceEntry entry = (WorkspaceEntry) (new BeanBuilder().createObject(WorkspaceEntry.class, jsonValue));

      assertNotNull(entry);
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonParserImpl

    *           will be generated Exception
    */
   private Object getObject(Class cl, byte[] data) throws Exception
   {
      JsonHandler jsonHandler = new JsonDefaultHandler();
      JsonParser jsonParser = new JsonParserImpl();
      InputStream inputStream = new ByteArrayInputStream(data);
      jsonParser.parse(inputStream, jsonHandler);
      JsonValue jsonValue = jsonHandler.getJsonObject();

      return new BeanBuilder().createObject(cl, jsonValue);
   }
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonParserImpl

    *           will be generated Exception
    */
   private Object getObject(Class cl, byte[] data) throws Exception
   {
      JsonHandler jsonHandler = new JsonDefaultHandler();
      JsonParser jsonParser = new JsonParserImpl();
      InputStream inputStream = new ByteArrayInputStream(data);
      jsonParser.parse(inputStream, jsonHandler);
      JsonValue jsonValue = jsonHandler.getJsonObject();

      return new BeanBuilder().createObject(cl, jsonValue);
   }
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.