public void writeJSONString(Writer out) throws IOException{ writeJSONString(this, out); }
/** * Saves to the file. */ @SuppressWarnings("unchecked") protected void save() { JSONArray array = new JSONArray(); for (BaseEntry entry : entries) { JSONObject obj = new JSONObject(); for (Entry<String, String> mapEntry : entry.write().entrySet()) { obj.put(mapEntry.getKey(), mapEntry.getValue()); } array.add(obj); } try (Writer writer = new FileWriter(file)) { array.writeJSONString(writer); } catch (Exception ex) { GlowServer.logger.log(Level.SEVERE, "Error writing to: " + file, ex); } }
@SuppressWarnings( "unchecked" ) private String buildJsonQueryResult( QueryResult queryResult ) throws KettleException { JSONArray list = new JSONArray(); for ( SObject sobject : queryResult.getRecords() ) { list.add( buildJSONSObject( sobject ) ); } StringWriter sw = new StringWriter(); try { list.writeJSONString( sw ); } catch ( IOException e ) { throw new KettleException( e ); } return sw.toString(); }
JSONArray.writeJSONString((List)value, out); return;
public void writeJSONString(Writer out) throws IOException{ writeJSONString(this, out); }
public void writeJSONString(Writer out) throws IOException { JSONArray.writeJSONString( Arrays.asList( bounds.getMinX(), bounds.getMinY(), bounds.getMaxX(), bounds.getMaxY()), out); } });
JSONArray.writeJSONString((List)value, out); return;
conferencesJSONArray.writeJSONString(response.getWriter());
public static String toJSONString(boolean[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }
public static String toJSONString(byte[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }
public static String toJSONString(short[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }
public static String toJSONString(long[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }
public static String toJSONString(double[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }
public static String toJSONString(Object[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }
public static String toJSONString(byte[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }
public static String toJSONString(int[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }
public static String toJSONString(float[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }
public static String toJSONString(char[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }
public static String toJSONString(int[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }
public static String toJSONString(boolean[] array){ final StringWriter writer = new StringWriter(); try { writeJSONString(array, writer); return writer.toString(); } catch(IOException e){ // This should never happen for a StringWriter throw new RuntimeException(e); } }