public final class StrictCharacterStreamJsonWriter extends java.lang.Object implements StrictJsonWriter
Writer.| Modifier and Type | Class and Description |
|---|---|
private static class |
StrictCharacterStreamJsonWriter.JsonContextType |
private static class |
StrictCharacterStreamJsonWriter.State |
private static class |
StrictCharacterStreamJsonWriter.StrictJsonContext |
| Modifier and Type | Field and Description |
|---|---|
private StrictCharacterStreamJsonWriter.StrictJsonContext |
context |
private StrictCharacterStreamJsonWriterSettings |
settings |
private StrictCharacterStreamJsonWriter.State |
state |
private java.io.Writer |
writer |
| Constructor and Description |
|---|
StrictCharacterStreamJsonWriter(java.io.Writer writer,
StrictCharacterStreamJsonWriterSettings settings)
Construct an instance.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
checkPreconditions(StrictCharacterStreamJsonWriter.State... validStates) |
private boolean |
checkState(StrictCharacterStreamJsonWriter.State... validStates) |
(package private) void |
flush() |
(package private) java.io.Writer |
getWriter() |
private void |
preWriteValue() |
private void |
setNextState() |
private void |
throwBSONException(java.io.IOException e) |
private void |
write(char c) |
private void |
write(java.lang.String str) |
void |
writeBoolean(boolean value)
Writes a boolean to the writer.
|
void |
writeBoolean(java.lang.String name,
boolean value)
Writes a a member with a boolean value to the writer.
|
void |
writeEndArray()
Writes the end of a JSON array to the writer.
|
void |
writeEndObject()
Writes the end of a JSON object to the writer.
|
void |
writeName(java.lang.String name)
Writes the name of a member to the writer.
|
void |
writeNull()
Writes a null value to the writer.
|
void |
writeNull(java.lang.String name)
Writes a member with a null value to the writer.
|
void |
writeNumber(java.lang.String value)
Writes a number to the writer.
|
void |
writeNumber(java.lang.String name,
java.lang.String value)
Writes a member with a numeric value to the writer.
|
void |
writeRaw(java.lang.String value)
Writes a raw value without quoting or escaping.
|
void |
writeRaw(java.lang.String name,
java.lang.String value)
Writes a member with a raw value without quoting or escaping.
|
void |
writeStartArray()
Writes the start of a array to the writer.
|
void |
writeStartArray(java.lang.String name)
Writes the start of JSON array member to the writer.
|
void |
writeStartObject()
Writes the start of a JSON object to the writer.
|
void |
writeStartObject(java.lang.String name)
Writes the start of a JSON object member to the writer.
|
void |
writeString(java.lang.String value)
Writes a String to the writer.
|
void |
writeString(java.lang.String name,
java.lang.String value)
Writes a member with a string value to the writer.
|
private void |
writeStringHelper(java.lang.String str) |
private final java.io.Writer writer
private final StrictCharacterStreamJsonWriterSettings settings
private StrictCharacterStreamJsonWriter.StrictJsonContext context
private StrictCharacterStreamJsonWriter.State state
public StrictCharacterStreamJsonWriter(java.io.Writer writer,
StrictCharacterStreamJsonWriterSettings settings)
writer - the writer to write JSON to.settings - the settings to apply to this writer.public void writeStartObject(java.lang.String name)
StrictJsonWriterwriteStartObject in interface StrictJsonWritername - the member namepublic void writeStartArray(java.lang.String name)
StrictJsonWriterwriteStartArray in interface StrictJsonWritername - the member namepublic void writeBoolean(java.lang.String name,
boolean value)
StrictJsonWriterwriteBoolean in interface StrictJsonWritername - the member namevalue - the boolean valuepublic void writeNumber(java.lang.String name,
java.lang.String value)
StrictJsonWriterwriteNumber in interface StrictJsonWritername - the member namevalue - the Double value, as a String so that clients can take full control over formattingpublic void writeString(java.lang.String name,
java.lang.String value)
StrictJsonWriterwriteString in interface StrictJsonWritername - the member namevalue - the String valuepublic void writeRaw(java.lang.String name,
java.lang.String value)
StrictJsonWriterwriteRaw in interface StrictJsonWritername - the member namevalue - the raw valuepublic void writeNull(java.lang.String name)
StrictJsonWriterwriteNull in interface StrictJsonWritername - the member namepublic void writeName(java.lang.String name)
StrictJsonWriterwriteName in interface StrictJsonWritername - the member namepublic void writeBoolean(boolean value)
StrictJsonWriterwriteBoolean in interface StrictJsonWritervalue - the boolean value.public void writeNumber(java.lang.String value)
StrictJsonWriterwriteNumber in interface StrictJsonWritervalue - the Double value, as a String so that clients can take full control over formattingpublic void writeString(java.lang.String value)
StrictJsonWriterwriteString in interface StrictJsonWritervalue - the String valuepublic void writeRaw(java.lang.String value)
StrictJsonWriterwriteRaw in interface StrictJsonWritervalue - the String valuepublic void writeNull()
StrictJsonWriterwriteNull in interface StrictJsonWriterpublic void writeStartObject()
StrictJsonWriterwriteStartObject in interface StrictJsonWriterpublic void writeStartArray()
StrictJsonWriterwriteStartArray in interface StrictJsonWriterpublic void writeEndObject()
StrictJsonWriterwriteEndObject in interface StrictJsonWriterpublic void writeEndArray()
StrictJsonWriterwriteEndArray in interface StrictJsonWritervoid flush()
java.io.Writer getWriter()
private void preWriteValue()
private void setNextState()
private void writeStringHelper(java.lang.String str)
private void write(java.lang.String str)
private void write(char c)
private void checkPreconditions(StrictCharacterStreamJsonWriter.State... validStates)
private boolean checkState(StrictCharacterStreamJsonWriter.State... validStates)
private void throwBSONException(java.io.IOException e)