Package org.apache.openjpa.json
Class JSONObject
- java.lang.Object
-
- org.apache.openjpa.json.JSONObject
-
- All Implemented Interfaces:
JSON
public class JSONObject extends java.lang.Object implements JSON
A JSON instance for persistence.
Persistent instances have a persistent identity that extends beyond the process lifetime unlike other common identity such as identity hash code for a Java instance in a JVM.
A JSONObject instance must need such a persistent identity.- Author:
- Pinaki Poddar
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JSONObject.Array
An array of objects.static class
JSONObject.KVMap
A map whose key or value can be JSON.
-
Field Summary
-
Fields inherited from interface org.apache.openjpa.json.JSON
ARRAY_EMPTY, ARRAY_END, ARRAY_START, FIELD_SEPARATOR, ID_MARKER, IOR_SEPARTOR, MEMBER_SEPARATOR, NEWLINE, NULL_LITERAL, OBJECT_END, OBJECT_START, QUOTE, REF_MARKER, SPACE, VALUE_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description JSONObject(java.lang.String type, java.lang.Object id, boolean ref)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBuilder
asString(int indent)
Render into a string buffer.static void
main(java.lang.String[] args)
void
set(java.lang.String key, java.lang.Object value)
java.lang.String
toString()
void
write(java.io.PrintWriter writer)
-
-
-
Method Detail
-
set
public void set(java.lang.String key, java.lang.Object value)
-
write
public void write(java.io.PrintWriter writer)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
asString
public java.lang.StringBuilder asString(int indent)
Description copied from interface:JSON
Render into a string buffer.
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-