Class JsonGeneratorImpl
java.lang.Object
org.eclipse.parsson.JsonGeneratorImpl
- All Implemented Interfaces:
jakarta.json.stream.JsonGenerator, Closeable, Flushable, AutoCloseable
- Direct Known Subclasses:
JsonPrettyGeneratorImpl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final char[]private final BufferPoolprivate booleanprivate JsonGeneratorImpl.Contextprivate static final char[]private static final char[]private static final char[]All possible chars for representing a number as a Stringprivate static final int[]private static final char[]private intprivate final Deque<JsonGeneratorImpl.Context> private final WriterFields inherited from interface jakarta.json.stream.JsonGenerator
PRETTY_PRINTING -
Constructor Summary
ConstructorsConstructorDescriptionJsonGeneratorImpl(OutputStream out, Charset encoding, JsonContext jsonContext) JsonGeneratorImpl(OutputStream out, JsonContext jsonContext) JsonGeneratorImpl(Writer writer, JsonContext jsonContext) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidvoidclose()private static voidfillIntChars(int i, char[] buf, int index) Places characters representing the integer i into the character array buf.voidflush()(package private) void(package private) voidgetChars(CharSequence str, int srcBegin, int srcEnd, char[] dst, int dstBegin) protected booleaninNone()(package private) booleanprivate voidprivate static intstringSize(int x) jakarta.json.stream.JsonGeneratorwrite(boolean value) jakarta.json.stream.JsonGeneratorwrite(double value) jakarta.json.stream.JsonGeneratorwrite(int value) jakarta.json.stream.JsonGeneratorwrite(long value) jakarta.json.stream.JsonGeneratorwrite(jakarta.json.JsonValue value) jakarta.json.stream.JsonGeneratorjakarta.json.stream.JsonGeneratorjakarta.json.stream.JsonGeneratorjakarta.json.stream.JsonGeneratorjakarta.json.stream.JsonGeneratorjakarta.json.stream.JsonGenerator(package private) voidwrite(String name, CharSequence fieldValue) jakarta.json.stream.JsonGeneratorjakarta.json.stream.JsonGeneratorwrite(String name, BigDecimal value) jakarta.json.stream.JsonGeneratorwrite(String name, BigInteger value) jakarta.json.stream.JsonGeneratorwrite(BigDecimal value) jakarta.json.stream.JsonGeneratorwrite(BigInteger value) (package private) voidwriteChar(char c) protected voidprotected voidjakarta.json.stream.JsonGeneratorwriteEnd()(package private) voidwriteEscapedString(CharSequence string) (package private) voidwriteInt(int num) jakarta.json.stream.JsonGeneratorprivate jakarta.json.stream.JsonGeneratorjakarta.json.stream.JsonGeneratorjakarta.json.stream.JsonGeneratorjakarta.json.stream.JsonGeneratorjakarta.json.stream.JsonGeneratorwriteStartArray(String name) jakarta.json.stream.JsonGeneratorjakarta.json.stream.JsonGeneratorwriteStartObject(String name) (package private) voidwriteString(CharSequence str) (package private) voidwriteString(CharSequence str, int begin, int end) private voidwriteValue(String value) private voidwriteValue(String name, String value)
-
Field Details
-
INT_MIN_VALUE_CHARS
private static final char[] INT_MIN_VALUE_CHARS -
INT_CHARS_SIZE_TABLE
private static final int[] INT_CHARS_SIZE_TABLE -
DIGIT_TENS
private static final char[] DIGIT_TENS -
DIGIT_ONES
private static final char[] DIGIT_ONES -
DIGITS
private static final char[] DIGITSAll possible chars for representing a number as a String -
bufferPool
-
writer
-
currentContext
-
stack
-
buf
private final char[] buf -
len
private int len -
closed
private boolean closed
-
-
Constructor Details
-
JsonGeneratorImpl
JsonGeneratorImpl(Writer writer, JsonContext jsonContext) -
JsonGeneratorImpl
JsonGeneratorImpl(OutputStream out, JsonContext jsonContext) -
JsonGeneratorImpl
JsonGeneratorImpl(OutputStream out, Charset encoding, JsonContext jsonContext)
-
-
Method Details
-
flush
-
writeStartObject
public jakarta.json.stream.JsonGenerator writeStartObject()- Specified by:
writeStartObjectin interfacejakarta.json.stream.JsonGenerator
-
writeStartObject
- Specified by:
writeStartObjectin interfacejakarta.json.stream.JsonGenerator
-
writeName
-
write
-
write
- Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
write
- Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
write
- Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
write
- Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
write
- Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
write
- Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
writeNull
- Specified by:
writeNullin interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(jakarta.json.JsonValue value) - Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
writeStartArray
public jakarta.json.stream.JsonGenerator writeStartArray()- Specified by:
writeStartArrayin interfacejakarta.json.stream.JsonGenerator
-
writeStartArray
- Specified by:
writeStartArrayin interfacejakarta.json.stream.JsonGenerator
-
write
- Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
write
- Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(int value) - Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(long value) - Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(double value) - Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
write
- Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
checkContextForValue
private void checkContextForValue() -
write
- Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
popFieldContext
private void popFieldContext() -
write
public jakarta.json.stream.JsonGenerator write(boolean value) - Specified by:
writein interfacejakarta.json.stream.JsonGenerator
-
writeNull
public jakarta.json.stream.JsonGenerator writeNull()- Specified by:
writeNullin interfacejakarta.json.stream.JsonGenerator
-
writeValue
-
writeValue
-
writeKey
- Specified by:
writeKeyin interfacejakarta.json.stream.JsonGenerator
-
writeEnd
public jakarta.json.stream.JsonGenerator writeEnd()- Specified by:
writeEndin interfacejakarta.json.stream.JsonGenerator
-
write
-
writeComma
protected void writeComma() -
inNone
protected boolean inNone() -
isCommaAllowed
boolean isCommaAllowed() -
writeColon
protected void writeColon() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfacejakarta.json.stream.JsonGenerator
-
writeEscapedString
-
writeString
-
writeString
-
writeChar
void writeChar(char c) -
writeInt
void writeInt(int num) -
flushBuffer
void flushBuffer() -
stringSize
private static int stringSize(int x) -
getChars
-
fillIntChars
private static void fillIntChars(int i, char[] buf, int index) Places characters representing the integer i into the character array buf. The characters are placed into the buffer backwards starting with the least significant digit at the specified index (exclusive), and working backwards from there. Will fail if i == Integer.MIN_VALUE
-