public static interface JsonWriter.JsonClassWriter
Modifier and Type | Method and Description |
---|---|
default boolean |
hasPrimitiveForm() |
default boolean |
hasPrimitiveForm(WriterContext context) |
default void |
write(Object o,
boolean showType,
Writer output)
When write() is called, it is expected that subclasses will write the appropriate JSON
to the passed in Writer.
|
default void |
write(Object o,
boolean showType,
Writer output,
WriterContext context)
When write() is called, it is expected that subclasses will write the appropriate JSON
to the passed in Writer.
|
default void |
writePrimitiveForm(Object o,
Writer output)
This method will be called to write the item in primitive form (if the response to hasPrimitiveForm()
was true).
|
default void |
writePrimitiveForm(Object o,
Writer output,
WriterContext context)
This default implementation will call the more basic writePrimitiveForm that does not take arguments.
|
default void write(Object o, boolean showType, Writer output, WriterContext context) throws IOException
o
- Object to be written in JSON format.showType
- boolean indicating whether to show @type.output
- Writer destination to where the actual JSON is written.context
- WriterContext to get writeOptions and other write accessIOException
- if thrown by the writer. Will be caught at a higher level and wrapped in JsonIoException.default void write(Object o, boolean showType, Writer output) throws IOException
o
- Object to be written in JSON format.showType
- boolean indicating whether to show @type.output
- Writer destination to where the actual JSON is written.IOException
- if thrown by the writer. Will be caught at a higher level and wrapped in JsonIoException.default boolean hasPrimitiveForm(WriterContext context)
default boolean hasPrimitiveForm()
default void writePrimitiveForm(Object o, Writer output, WriterContext context) throws IOException
o
- Object to be writtenoutput
- Writer destination to where the actual JSON is written.context
- WriterContext to get access to writeOptions and writing toolsIOException
- if thrown by the writer. Will be caught at a higher level and wrapped in JsonIoException.default void writePrimitiveForm(Object o, Writer output) throws IOException
o
- Object to be writtenoutput
- Writer destination to where the actual JSON is written.IOException
- if thrown by the writer. Will be caught at a higher level and wrapped in JsonIoException.Copyright © 2024. All rights reserved.