Uses of Interface
net.sf.json.JSON
Packages that use JSON
Package
Description
The core of the library
Testing utilities
Miscelaneous utilities
Utilities for trasforming JSON to XML and back.
-
Uses of JSON in net.sf.json
Classes in net.sf.json that implement JSONModifier and TypeClassDescription(package private) classBase class for JSONObject and JSONArray.final classA JSONArray is an ordered sequence of values.final classJSONNull is equivalent to the value that JavaScript calls null, whilst Java's null is equivalent to the value that JavaScript calls undefined.final classA JSONObject is an unordered collection of name/value pairs.Methods in net.sf.json that return JSONModifier and TypeMethodDescriptionstatic JSONCreates a JSONObject, JSONArray or a JSONNull from object.
Accepts JSON formatted strings, Maps, arrays, Collections, DynaBeans and JavaBeans.static JSONJSONSerializer.toJSON(Object object, JsonConfig jsonConfig) Creates a JSONObject, JSONArray or a JSONNull from object.
Accepts JSON formatted strings, Maps, arrays, Collections, DynaBeans and JavaBeans.private static JSONJSONSerializer.toJSON(String string, JsonConfig jsonConfig) Creates a JSONObject, JSONArray or a JSONNull from a JSONString.private static JSONJSONSerializer.toJSON(JSONString string, JsonConfig jsonConfig) Creates a JSONObject, JSONArray or a JSONNull from a JSONString.Methods in net.sf.json with parameters of type JSONModifier and TypeMethodDescriptionvoidstatic ObjectTransform 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 ObjectJSONSerializer.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. -
Uses of JSON in net.sf.json.test
Methods in net.sf.json.test with parameters of type JSONModifier and TypeMethodDescriptionstatic voidJSONAssert.assertEquals(String message, JSON expected, JSON actual) Asserts that two JSON values are equal.static voidJSONAssert.assertEquals(JSON expected, JSON actual) Asserts that two JSON values are equal.static voidJSONAssert.assertNotNull(String message, JSON json) Asserts that a JSON value is not null.
Fails if: JSONNull.getInstance().equals( json ) ((JSONObject) json).isNullObject()static voidJSONAssert.assertNotNull(JSON json) Asserts that a JSON value is not null.
Fails if: JSONNull.getInstance().equals( json ) ((JSONObject) json).isNullObject()static voidJSONAssert.assertNull(String message, JSON json) Asserts that a JSON value is null.
Fails if: !JSONNull.getInstance().equals( json ) !((JSONObject) json).isNullObject()static voidJSONAssert.assertNull(JSON json) Asserts that a JSON value is null.
Fails if: !JSONNull.getInstance().equals( json ) !((JSONObject) json).isNullObject() -
Uses of JSON in net.sf.json.util
Methods in net.sf.json.util with parameters of type JSONModifier and TypeMethodDescriptionstatic StringTransforms the input Json string using the configured WebHijackPreventionStrategy.static StringTransforms the input Json string using the configured WebHijackPreventionStrategy.static StringReturns a string represenation of a JSON value.
When an object property name does not contain a space (' ') or a colon (':'), the quotes are omitted. -
Uses of JSON in net.sf.json.xml
Methods in net.sf.json.xml that return JSONModifier and TypeMethodDescriptionprivate JSONXMLSerializer.processArrayElement(nu.xom.Element element, String defaultType) private JSONXMLSerializer.processObjectElement(nu.xom.Element element, String defaultType) Creates a JSON value from a XML string.XMLSerializer.readFromFile(File file) Creates a JSON value from a File.XMLSerializer.readFromFile(String path) Creates a JSON value from a File.XMLSerializer.readFromStream(InputStream stream) Creates a JSON value from an input stream.Methods in net.sf.json.xml with parameters of type JSONModifier and TypeMethodDescriptionWrites a JSON value into a XML string with UTF-8 encoding.Writes a JSON value into a XML string with an specific encoding.
If the encoding string is null it will use UTF-8.