Package org.jmol.util

Class JSONWriter

java.lang.Object
org.jmol.util.JSONWriter
Direct Known Subclasses:
QCJSONWriter

public class JSONWriter extends Object
  • Field Details

    • oc

      protected OC oc
    • indent

      protected int indent
  • Constructor Details

    • JSONWriter

      public JSONWriter()
  • Method Details

    • setModifyKeys

      public void setModifyKeys(Map<String,String> mapNewToOld)
    • setWriteNullAsString

      public void setWriteNullAsString(boolean b)
      Set option to write a null as the string "null" or just null itself.
      Parameters:
      b -
    • append

      protected OC append(String s)
    • setStream

      public void setStream(OutputStream os)
    • closeStream

      public boolean closeStream()
    • writeObject

      public void writeObject(Object o)
    • writeNull

      public void writeNull()
    • writeNumber

      public void writeNumber(Number o)
    • writeBoolean

      public void writeBoolean(Boolean o)
    • writeString

      public void writeString(String str)
    • writeString

      public void writeString(String str, SB sbSym)
    • writeMap

      public void writeMap(Map<String,Object> map)
    • getAndCheckValue

      protected Object getAndCheckValue(Map<String,Object> map, String key)
    • mapOpen

      public void mapOpen()
    • mapClose

      public void mapClose()
    • mapAddKey

      public void mapAddKey(String key)
    • mapAddKeyValue

      public void mapAddKeyValue(String key, Object value, String terminator)
    • mapAddKeyValueRaw

      public void mapAddKeyValueRaw(String key, Object value, String terminator)
      Add a key:value pair where value is already quoted
      Parameters:
      key -
      value -
      terminator - TODO
    • mapAddMapAllExcept

      public void mapAddMapAllExcept(String key, Map<String,Object> map, String except)
    • writeList

      public void writeList(List<Object> list)
    • writeArray

      public void writeArray(Object o)
    • arrayOpen

      public void arrayOpen(boolean andIndent)
    • arrayAdd

      public void arrayAdd(Object o)
    • arrayClose

      public void arrayClose(boolean andIndent)
    • setWhiteSpace

      public void setWhiteSpace(boolean b)