Package | Description |
---|---|
net.sf.json |
The core of the library
|
net.sf.json.test |
Testing utilities
|
net.sf.json.util |
Miscelaneous utilities
|
net.sf.json.xml |
Utilities for trasforming JSON to XML and back.
|
Modifier and Type | Class and Description |
---|---|
class |
JSONArray
A JSONArray is an ordered sequence of values.
|
class |
JSONNull
JSONNull is equivalent to the value that JavaScript calls null, whilst Java's
null is equivalent to the value that JavaScript calls undefined.
|
class |
JSONObject
A JSONObject is an unordered collection of name/value pairs.
|
Modifier and Type | Method and Description |
---|---|
static JSON |
JSONSerializer.toJSON(java.lang.Object object)
Creates a JSONObject, JSONArray or a JSONNull from object.
|
static JSON |
JSONSerializer.toJSON(java.lang.Object object,
JsonConfig jsonConfig)
Creates a JSONObject, JSONArray or a JSONNull from object.
|
Modifier and Type | Method and Description |
---|---|
protected V |
DelegatingValueVisitor.accept(JSON json) |
static java.lang.Object |
JSONSerializer.toJava(JSON json)
Transform a JSON value to a java object.
Depending on the configured values for conversion this will return a DynaBean, a bean, a List, or and array. |
static java.lang.Object |
JSONSerializer.toJava(JSON json,
JsonConfig jsonConfig)
Transform a JSON value to a java object.
Depending on the configured values for conversion this will return a DynaBean, a bean, a List, or and array. |
Modifier and Type | Method and Description |
---|---|
static void |
JSONAssert.assertEquals(JSON expected,
JSON actual)
Asserts that two JSON values are equal.
|
static void |
JSONAssert.assertEquals(java.lang.String message,
JSON expected,
JSON actual)
Asserts that two JSON values are equal.
|
static void |
JSONAssert.assertNotNull(JSON json)
Asserts that a JSON value is not null.
Fails if: JSONNull.getInstance().equals( json ) ((JSONObject) json).isNullObject() |
static void |
JSONAssert.assertNotNull(java.lang.String message,
JSON json)
Asserts that a JSON value is not null.
Fails if: JSONNull.getInstance().equals( json ) ((JSONObject) json).isNullObject() |
static void |
JSONAssert.assertNull(JSON json)
Asserts that a JSON value is null.
Fails if: !JSONNull.getInstance().equals( json ) !((JSONObject) json).isNullObject() |
static void |
JSONAssert.assertNull(java.lang.String message,
JSON json)
Asserts that a JSON value is null.
Fails if: !JSONNull.getInstance().equals( json ) !((JSONObject) json).isNullObject() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
WebUtils.protect(JSON json)
Transforms the input Json string using the configured
WebHijackPreventionStrategy.
|
static java.lang.String |
WebUtils.protect(JSON json,
boolean shrink)
Transforms the input Json string using the configured
WebHijackPreventionStrategy.
|
static java.lang.String |
WebUtils.toString(JSON json)
Returns a string represenation of a JSON value.
When an object property name does not contain a space (' ') or a colon (':'), the quotes are omitted. |
Modifier and Type | Method and Description |
---|---|
JSON |
XMLSerializer.read(java.lang.String xml)
Creates a JSON value from a XML string.
|
JSON |
XMLSerializer.readFromFile(java.io.File file)
Creates a JSON value from a File.
|
JSON |
XMLSerializer.readFromFile(java.lang.String path)
Creates a JSON value from a File.
|
JSON |
XMLSerializer.readFromStream(java.io.InputStream stream)
Creates a JSON value from an input stream.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
XMLSerializer.write(JSON json)
Writes a JSON value into a XML string with UTF-8 encoding.
|
java.lang.String |
XMLSerializer.write(JSON json,
java.lang.String encoding)
Writes a JSON value into a XML string with an specific encoding.
If the encoding string is null it will use UTF-8. |
Copyright © 2006-2014 Json-lib. All Rights Reserved.