Tabnine Logo
JSONArray.writeJSONString
Code IndexAdd Tabnine to your IDE (free)

How to use
writeJSONString
method
in
org.json.simple.JSONArray

Best Java code snippets using org.json.simple.JSONArray.writeJSONString (Showing top 20 results out of 315)

origin: com.googlecode.json-simple/json-simple

public void writeJSONString(Writer out) throws IOException{
  writeJSONString(this, out);
}
 
origin: GlowstoneMC/Glowstone

/**
 * 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);
  }
}
origin: pentaho/pentaho-kettle

@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();
}
origin: com.googlecode.json-simple/json-simple

JSONArray.writeJSONString((List)value, out);
return;
origin: i2p/i2p.i2p

public void writeJSONString(Writer out) throws IOException{
  writeJSONString(this, out);
}
 
origin: geotools/geotools

  public void writeJSONString(Writer out) throws IOException {
    JSONArray.writeJSONString(
        Arrays.asList(
            bounds.getMinX(),
            bounds.getMinY(),
            bounds.getMaxX(),
            bounds.getMaxY()),
        out);
  }
});
origin: i2p/i2p.i2p

JSONArray.writeJSONString((List)value, out);
return;
origin: jitsi/jitsi-videobridge

conferencesJSONArray.writeJSONString(response.getWriter());
origin: fangyidong/json-simple

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);
  }
}
 
origin: childe/hangout

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);
  }
}
 
origin: fangyidong/json-simple

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);
  }
}
 
origin: fangyidong/json-simple

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);
  }
}
 
origin: fangyidong/json-simple

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);
  }
}
 
origin: fangyidong/json-simple

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);
  }
}
 
origin: fangyidong/json-simple

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);
  }
}
 
origin: fangyidong/json-simple

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);
  }
}
 
origin: fangyidong/json-simple

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);
  }
}
 
origin: fangyidong/json-simple

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);
  }
}
 
origin: childe/hangout

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);
  }
}
 
origin: childe/hangout

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);
  }
}
 
org.json.simpleJSONArraywriteJSONString

Javadoc

Encode a list into JSON text and write it to out. If this list is also a JSONStreamAware or a JSONAware, JSONStreamAware and JSONAware specific behaviours will be ignored at this top level.

Popular methods of JSONArray

  • <init>
  • add
  • size
  • get
  • toJSONString
    Convert a list to JSON text. The result is a JSON array. If this list is also a JSONAware, JSONAware
  • iterator
  • addAll
  • isEmpty
  • toString
  • toArray
  • contains
  • remove
  • contains,
  • remove,
  • set,
  • clear,
  • forEach,
  • getJsonObject,
  • listIterator,
  • subList

Popular in Java

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now