Examples of JsonParser


Examples of org.codehaus.jackson.JsonParser

    result.add(new JsonElement(null));
    return result;
  }

  private JsonParser makeParser(final List<JsonElement> elements) throws IOException {
    return new JsonParser() {
      int pos = 0;

      @Override
      public ObjectCodec getCodec() {
        throw new UnsupportedOperationException();
View Full Code Here

Examples of org.directwebremoting.json.parse.JsonParser

            // I'm of the opinion that allow any kind of RPC over GET without an
            // explicit @idempotent marker is probably against the HTTP spec
            // Plus there are additional security issues with GET requests
            // So I'm not rushing to fix this error
            Reader in = request.getReader();
            JsonParser parser = JsonParserFactory.get();
            calls = (JsonRpcCalls) parser.parse(in, new JsonRpcCallsJsonDecoder(converterManager, moduleManager));

            if (calls.getCallCount() != 1)
            {
                JsonRpcError error = new JsonRpcError(calls, "Non unique call", ERROR_CODE_INTERNAL, null);
                writeResponse(error, response, SC_INTERNAL_SERVER_ERROR);
View Full Code Here

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

    *           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.jooq.tools.json.JSONParser

    private String[]             fieldMetaData;
    private List<String[]>       records;

    public JSONReader(Reader reader) {
        this.br = new BufferedReader(reader);
        this.parser = new JSONParser();
    }
View Full Code Here

Examples of org.jose4j.json.internal.json_simple.parser.JSONParser

    public static Map<String,Object> parseJson(String jsonString) throws JoseException
    {
        try
        {
            JSONParser parser = new JSONParser();
            return (DupeKeyDisallowingLinkedHashMap)parser.parse(jsonString, CONTAINER_FACTORY);
        }
        catch (ParseException | IllegalArgumentException e)
        {
            throw new JoseException("Parsing error: " + e, e);
        }
View Full Code Here

Examples of org.json.simple.parser.JSONParser

     
      @Override
      public void translate(Writer writer) throws TransformerException,
          IOException {
          try {
            JSONParser parser = new JSONParser();
          XMLOutputFactory factory = getOutputFactory();
          final XMLStreamWriter streamWriter = factory.createXMLStreamWriter(writer);
           
          parser.parse(r, new JsonToXmlContentHandler(escapeName(rootName, true), streamWriter));
           
          streamWriter.flush(); //woodstox needs a flush rather than a close
        } catch (XMLStreamException e) {
          throw new TransformerException(e);
        } catch (ParseException e) {
View Full Code Here

Examples of org.json.simple.parser.JSONParser

   * @param in
   * @return instance of : JSONObject,JSONArray,String,Boolean,Long,Double or null
   */
  public static Object parse(Reader in){
    try{
      JSONParser parser=new JSONParser();
      return parser.parse(in);
    }
    catch(Exception e){
      return null;
    }
  }
View Full Code Here

Examples of org.json.simple.parser.JSONParser

    }

    JSONUnpacker(MessagePack msgpack, Reader in) {
        super(msgpack, null);
        this.in = in;
        this.parser = new JSONParser();
    }
View Full Code Here

Examples of org.json.simple.parser.JSONParser

    Assert.assertEquals("http://www.geomajas.org/url1",
        fixSlash(feature.getAttributes().get("urlAttr").getValue().toString()));

    view.render(mav.getModel(), request, response);
    response.flushBuffer();
    Object json = new JSONParser().parse(response.getContentAsString());
    String isodate = GeoJSONUtil.DATE_FORMAT.format(c.getTime());
    Assert.assertTrue(json instanceof JSONObject);
    Assert.assertEquals("{\"type\":\"Feature\"," + "\"geometry\":{\"type\":\"MultiPolygon\","
        + "\"coordinates\":[[[[0.0,0.0],[1,0.0],[1,1],[0.0,1],[0.0,0.0]]]]}," + "\"properties\":{"
        + "\"stringAttr\":\"bean1\"," + "\"booleanAttr\":true," + "\"currencyAttr\":\"100,23\","
View Full Code Here

Examples of org.json.simple.parser.JSONParser

    request.setParameter("stringAttr_eq", "bean1");
    request.setParameter("epsg", "900913");
    ModelAndView mav = adapter.handle(request, response, restController);
    view.render(mav.getModel(), request, response);
    response.flushBuffer();
    Object json = new JSONParser().parse(response.getContentAsString());
    Assert.assertTrue(json instanceof JSONObject);
    JSONObject jsonObject = (JSONObject) json;
    JSONArray features = (JSONArray) jsonObject.get("features");
    JSONObject feature = (JSONObject) features.get(0);
    JSONObject geometry = (JSONObject) feature.get("geometry");
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.