public static interface JsonWriter.JsonClassWriter extends JsonWriter.JsonClassWriterBase
Modifier and Type | Method and Description |
---|---|
default JsonWriter |
getWriter(Map<String,Object> args)
return the JsonWriter instance performing the overall work.
|
default boolean |
hasPrimitiveForm() |
default boolean |
hasPrimitiveForm(Map args) |
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,
Map<String,Object> args)
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,
Map args)
This default implementation will call the more basic writePrimitiveForm that does not take arguments.
|
default void write(Object o, boolean showType, Writer output, Map<String,Object> args) 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.args
- Map of 'settings' arguments initially passed into the JsonWriter.IOException
- 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(Map args)
default boolean hasPrimitiveForm()
default void writePrimitiveForm(Object o, Writer output, Map args) throws IOException
o
- Object to be writtenoutput
- Writer destination to where the actual JSON is written.args
- Map of 'settings' arguments initially passed into the JsonWriter.IOException
- 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.default JsonWriter getWriter(Map<String,Object> args)
args
- Map of settings initially passed to JsonWriter.Copyright © 2023. All rights reserved.