- 
- All Known Implementing Classes:
- DynamicMappingGenerator,- DynamicMappingGenerator.SkipEnclosingWriteEnd,- MappingGeneratorImpl
 
 public interface MappingGeneratorHandles writing Json for Objects. Internally it uses aJsonGeneratorto write JSON To write JSON-P structure elements you can use thegetJsonGenerator()method.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description jakarta.json.stream.JsonGeneratorgetJsonGenerator()MappingGeneratorwriteObject(java.lang.Object o, jakarta.json.stream.JsonGenerator generator)Write the given Object o into the current JSON layer.default MappingGeneratorwriteObject(java.lang.String key, java.lang.Object o, jakarta.json.stream.JsonGenerator generator)
 
- 
- 
- 
Method Detail- 
getJsonGeneratorjakarta.json.stream.JsonGenerator getJsonGenerator() - Returns:
- the JsonGeneratorused internally to write the JSON output.
 
 - 
writeObjectMappingGenerator writeObject(java.lang.Object o, jakarta.json.stream.JsonGenerator generator) Write the given Object o into the current JSON layer. This will not open a new json layer ('{', '}') but really just write the attributes of o to the currently opened layer. Consider you have a classpublic class Customer { private String firstName; private String lastName; private Address address; ... }then the resulting JSON String will e.g. look like"firstName":"Karl", "lastName":"SomeName", "address":{"street":"mystreet"}- Parameters:
- o- the object to write
- generator- the jsonp generator to use
- Returns:
- itself, for easier chaining of commands
 
 - 
writeObjectdefault MappingGenerator writeObject(java.lang.String key, java.lang.Object o, jakarta.json.stream.JsonGenerator generator) 
 
- 
 
-