/** * To create PdxInstance from JSON string * * @return the PdxInstance. * @throws JSONFormatterException if unable to parse JSON doucment */ public static PdxInstance fromJSON(String jsonString) { JsonParser jp = null; try { jp = new JsonFactory().createParser(jsonString); enableJSONParserFeature(jp); return new JSONFormatter().getPdxInstance(jp, states.NONE, null).getPdxInstance(); } catch (JsonParseException jpe) { throw new JSONFormatterException("Could not parse JSON document " , jpe); } catch (IOException e) { throw new JSONFormatterException("Could not parse JSON document: " + jp.getCurrentLocation(), e); } catch(Exception e) { throw new JSONFormatterException("Could not parse JSON document: " + jp.getCurrentLocation(), e); } }
/** * To create PdxInstance from JSON string * * @return the PdxInstance. * @throws JSONFormatterException if unable to parse JSON doucment */ public static PdxInstance fromJSON(byte[] jsonByteArray) { JsonParser jp = null; try { jp = new JsonFactory().createParser(jsonByteArray); enableJSONParserFeature(jp); return new JSONFormatter().getPdxInstance(jp, states.NONE, null).getPdxInstance(); } catch (JsonParseException jpe) { throw new JSONFormatterException("Could not parse JSON document " , jpe); } catch (IOException e) { throw new JSONFormatterException("Could not parse JSON document: " + jp.getCurrentLocation(), e); } catch(Exception e) { throw new JSONFormatterException("Could not parse JSON document: " + jp.getCurrentLocation(), e); } }
/** * To create PdxInstance from JSON string * * @return the PdxInstance. * @throws JSONFormatterException if unable to parse JSON doucment */ public static PdxInstance fromJSON(String jsonString) { JsonParser jp = null; try { jp = new JsonFactory().createJsonParser(jsonString); enableJSONParserFeature(jp); return new JSONFormatter().getPdxInstance(jp, states.NONE, null).getPdxInstance(); } catch (JsonParseException jpe) { throw new JSONFormatterException("Could not parse JSON document " , jpe); } catch (IOException e) { throw new JSONFormatterException("Could not parse JSON document: " + jp.getCurrentLocation(), e); } catch(Exception e) { throw new JSONFormatterException("Could not parse JSON document: " + jp.getCurrentLocation(), e); } }
/** * To create PdxInstance from JSON string * * @return the PdxInstance. * @throws JSONFormatterException if unable to parse JSON doucment */ public static PdxInstance fromJSON(byte[] jsonByteArray) { JsonParser jp = null; try { jp = new JsonFactory().createJsonParser(jsonByteArray); enableJSONParserFeature(jp); return new JSONFormatter().getPdxInstance(jp, states.NONE, null).getPdxInstance(); } catch (JsonParseException jpe) { throw new JSONFormatterException("Could not parse JSON document " , jpe); } catch (IOException e) { throw new JSONFormatterException("Could not parse JSON document: " + jp.getCurrentLocation(), e); } catch(Exception e) { throw new JSONFormatterException("Could not parse JSON document: " + jp.getCurrentLocation(), e); } }