| Package | Description |
|---|---|
| org.json |
The json package.
|
| Modifier and Type | Method and Description |
|---|---|
JSONOptions |
JSONOptions.acceptJavascriptComments(boolean accept)
Set if javascript comments should be accepted.
|
static JSONOptions |
JSONOptions.createOptions()
Return a new JSONOptions with default parameters values.
|
static JSONOptions |
JSONOptions.getDefault()
Return the default options.
|
static JSONOptions |
JSONOptions.getOptions(JSONOptions options)
Return a not null JSONOptions.
|
JSONOptions |
JSONOptions.keepDecimalPoints(boolean keepDecimalPoints)
Set if decimal points must be kept in the serialized results for decimal values.
|
JSONOptions |
JSONOptions.keepKeysNaturalOrder(boolean keysNaturalOrder)
Set if the keys natural order should be kept.
|
JSONOptions |
JSONOptions.keepXMLStrings(boolean keepXMLStrings)
Set if values will not be coerced into boolean or numeric values and will instead be left as strings.
|
static JSONOptions |
JSONOptions.resetDefault()
Reset the default options.
|
JSONOptions |
JSONOptions.setCharSetName(java.lang.String charset)
Set the charset to use when reading or writing JSON content.
|
static JSONOptions |
JSONOptions.setDefaultAcceptJavascriptComments(boolean accept)
Set if javascript comments should be accepted, for the default options..
|
static JSONOptions |
JSONOptions.setDefaultCharSetName(java.lang.String charset)
Set the charset to use when reading or writing JSON content, for the default options.
|
static JSONOptions |
JSONOptions.setDefaultIndentationType(short indentType)
Set the result indentation type, for the default options.
|
static JSONOptions |
JSONOptions.setDefaultIndentFactor(int indentFactor)
Set the number of spaces to add to each level of indentation, for the default options.
|
static JSONOptions |
JSONOptions.setDefaultKeepDecimalPoints(boolean keepDecimalPoints)
Set if decimal points must be kept in the serialized results for decimal values, for the default options.
|
static JSONOptions |
JSONOptions.setDefaultKeepKeysNaturalOrder(boolean keysNaturalOrder)
Set if the keys natural order should be kept, for the default options.
|
static JSONOptions |
JSONOptions.setDefaultKeepXMLStrings(boolean keepXMLStrings)
Set if values will not be coerced into boolean or numeric values and will instead be left as strings, for the default options.
|
JSONOptions |
JSONOptions.setIndentationType(short indentType)
Set the result indentation type.
|
JSONOptions |
JSONOptions.setIndentFactor(int indentFactor)
Set the number of spaces to add to each level of indentation.
|
| Modifier and Type | Method and Description |
|---|---|
static JSONOptions |
JSONOptions.getOptions(JSONOptions options)
Return a not null JSONOptions.
|
static void |
FileUtils.toFile(JSONElement element,
java.io.File file,
JSONOptions options)
Save a JSONElement as a File.
|
static void |
FileUtils.toFile(JSONElement element,
java.io.File file,
java.lang.String var,
JSONOptions options)
Save a JSONElement as a File.
|
static JSONArray |
FileUtils.toJSONArray(java.io.File file,
JSONOptions options)
Load a File as a JSONArray.
|
static JSONArray |
FileUtils.toJSONArray(java.io.InputStream stream,
JSONOptions options)
Load an InputStream as a JSONArray.
|
static JSONArray |
FileUtils.toJSONArray(java.net.URL url,
JSONOptions options)
Load an URL as a JSONArray.
|
static JSONElement |
FileUtils.toJSONElement(java.io.File file,
JSONOptions options)
Load a File as a JSONElement.
|
static JSONElement |
FileUtils.toJSONElement(java.io.InputStream stream,
JSONOptions options)
Load an InputStream as a JSONElement.
|
static JSONElement |
FileUtils.toJSONElement(java.net.URL url,
JSONOptions options)
Load an URL as a JSONElement.
|
static JSONObject |
FileUtils.toJSONObject(java.io.File file,
JSONOptions options)
Load a File as a JSONObject.
|
static JSONObject |
FileUtils.toJSONObject(java.io.InputStream stream,
JSONOptions options)
Load an InputStream as a JSONObject.
|
static JSONObject |
FileUtils.toJSONObject(java.net.URL url,
JSONOptions options)
Load an URL as a JSONObject.
|
static JSONObject |
FileUtils.toJSONObjectFromXML(java.io.File file,
JSONOptions options)
Convert an XML File to a JSONObject.
|
static JSONObject |
FileUtils.toJSONObjectFromXML(java.net.URL url,
JSONOptions options)
Convert an XML URL to a JSONObject.
|
static void |
FileUtils.toURL(JSONElement element,
java.net.URL url,
JSONOptions options)
Save a JSONElement as an URL, using a specified indentFactor and indent.
|
static void |
FileUtils.toURL(JSONElement element,
java.net.URL url,
java.lang.String var,
JSONOptions options)
Save a JSONElement as an URL, using a specified indentFactor and indent.
|
java.io.Writer |
JSONArray.write(java.io.Writer writer,
int indent,
boolean isValue,
JSONOptions options)
Write the contents of the JSONArray as JSON text to a writer.
|
java.io.Writer |
JSONElement.write(java.io.Writer writer,
int indent,
boolean isValue,
JSONOptions options)
Write the contents of the JSONElement as JSON text to a writer.
|
java.io.Writer |
JSONObject.write(java.io.Writer writer,
int indent,
boolean isValue,
JSONOptions options)
Write the contents of the JSONObject as JSON text to a writer.
|
default java.io.Writer |
JSONElement.write(java.io.Writer writer,
int indent,
JSONOptions options)
Write the contents of the JSONElement as JSON text to a writer.
|
Copyright (C) 2017 Wei Song. Copyright (c) 2002 JSON.org. Copyright © 2018, 2019, 2026 Herve Girod. All Rights Reserved. elasticlunr Documentation and source under the MIT licence. JSON Documentation and source under the JSON licence