The System.JSONGenerator class is provided to enable the generation of standard JSON-encoded content and gives you more control on the structure of the JSON output.
The following are methods for JSONGenerator. All are instance methods.
public Void close()
Type: Void
No more content can be written after the JSON generator is closed.
public String getAsString()
Type: String
This method closes the JSON generator if it isn't closed already.
public Boolean isClosed()
Type: Boolean
public Void writeBlob(Blob blobValue)
Type: Void
public Void writeBoolean(Boolean blobValue)
Type: Void
public Void writeDate(Date dateValue)
Type: Void
public Void writeDateTime(Datetime datetimeValue)
Type: Void
public Void writeDateTimeField(String fieldName, Datetime datetimeValue)
Type: Void
public Void writeEndArray()
Type: Void
public Void writeEndObject()
Type: Void
public Void writeFieldName(String fieldName)
Type: Void
public Void writeId(ID identifier)
Type: Void
public Void writeNull()
Type: Void
public Void writeNullField(String fieldName)
Type: Void
public Void writeNumber(Decimal number)
Type: Void
public Void writeNumber(Double number)
Type: Void
public Void writeNumber(Integer number)
Type: Void
public Void writeNumber(Long number)
Type: Void
public Void writeObject(Object anyObject)
Type: Void
public Void writeObjectField(String fieldName, Object value)
Type: Void
public Void writeStartArray()
Type: Void
public Void writeStartObject()
Type: Void
public Void writeString(String stringValue)
Type: Void
public Void writeTime(Time timeValue)
Type: Void