Package com.director.core.json

Examples of com.director.core.json.JsonParser.format()


      public void format(DirectEvent[] events) {
         try {
            DirectConfiguration configuration = DirectContext.get().getConfiguration();
            JsonParser jsonParser = configuration.getParser();
            PrintWriter writer = this.response.getWriter();
            jsonParser.format(events, writer);
         } catch(IOException e) {
            throw new DirectException(e);
         }
      }
   }
View Full Code Here


         try {
            this.response.setContentType("text/html");
            JsonParser jsonParser = DirectContext.get().getConfiguration().getParser();
            PrintWriter writer = this.response.getWriter();
            writer.write("<html><body><textarea>");
            jsonParser.format(events, writer);
            writer.write("</textarea></body></html>");
         } catch(IOException e) {
            throw new DirectException(e);
         }
      }
View Full Code Here

         if(aClass != null && Map.class.isAssignableFrom(aClass)) {
            return (T) this.formData;
         }

         JsonParser parser = DirectContext.get().getConfiguration().getParser();
         String fromMapToJson = parser.format(this.formData);
         return (T) parser.parse(fromMapToJson, type);
      }

      throw new DirectException("Cannot access to parameter with order: " + order + " with form data");
   }
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.