Class JSONObject

java.lang.Object
org.apache.openjpa.json.JSONObject
All Implemented Interfaces:
JSON

public class JSONObject extends 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
  • Constructor Details

    • JSONObject

      public JSONObject(String type, Object id, boolean ref)
  • Method Details

    • set

      public void set(String key, Object value)
    • write

      public void write(PrintWriter writer)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • asString

      public StringBuilder asString(int indent)
      Description copied from interface: JSON
      Render into a string buffer.
      Specified by:
      asString in interface JSON
      Parameters:
      indent - level at which this instance is being rendered
      Returns:
      a mutable buffer
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception