# Class JSONWriter

java.lang.Object
org.jmol.util.JSONWriter

Direct Known Subclasses:
  `QCJSONWriter`

public class JSONWriter extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`protected int`
`indent`
`protected OC`
`oc`

## Constructor Summary

Constructors
Constructor
Description
`JSONWriter()`

## Method Summary

Modifier and Type
Method
Description
`protected OC`
`append(String s)`
`void`
`arrayAdd(Object o)`
`void`
`arrayClose(boolean andIndent)`
`void`
`arrayOpen(boolean andIndent)`
`boolean`
`closeStream()`
`protected Object`
`getAndCheckValue(Map<String,Object> map, String key)`
`void`
`mapAddKey(String key)`
`void`
`mapAddKeyValue(String key, Object value, String terminator)`
`void`
`mapAddKeyValueRaw(String key, Object value, String terminator)`
Add a key:value pair where value is already quoted
`void`
`mapAddMapAllExcept(String key, Map<String,Object> map, String except)`
`void`
`mapClose()`
`void`
`mapOpen()`
`void`
`setModifyKeys(Map<String,String> mapNewToOld)`
`void`
`setStream(OutputStream os)`
`void`
`setWhiteSpace(boolean b)`
`void`
`setWriteNullAsString(boolean b)`
Set option to write a null as the string "null" or just null itself.
`void`
`writeArray(Object o)`
`void`
`writeBoolean(Boolean o)`
`void`
`writeList(List<Object> list)`
`void`
`writeMap(Map<String,Object> map)`
`void`
`writeNull()`
`void`
`writeNumber(Number o)`
`void`
`writeObject(Object o)`
`void`
`writeString(String str)`
`void`
`writeString(String str, SB sbSym)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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)