Package org.apache.johnzon.mapper
Class MappingGeneratorImpl
java.lang.Object
org.apache.johnzon.mapper.MappingGeneratorImpl
- All Implemented Interfaces:
MappingGenerator
-
Method Summary
Modifier and TypeMethodDescriptionvoiddoWriteObject(Object object, jakarta.json.stream.JsonGenerator generator, boolean writeBody, Collection<String> ignoredProperties, JsonPointerTracker jsonPointer) writeObject(Object object, jakarta.json.stream.JsonGenerator generator) Write the given Object o into the current JSON layer.writeObject(String key, Object object, jakarta.json.stream.JsonGenerator generator)
-
Method Details
-
writeObject
public MappingGenerator writeObject(String key, Object object, jakarta.json.stream.JsonGenerator generator) - Specified by:
writeObjectin interfaceMappingGenerator
-
writeObject
Description copied from interface:MappingGeneratorWrite 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"}- Specified by:
writeObjectin interfaceMappingGenerator- Parameters:
object- the object to writegenerator- the jsonp generator to use- Returns:
- itself, for easier chaining of commands
-
doWriteObject
public void doWriteObject(Object object, jakarta.json.stream.JsonGenerator generator, boolean writeBody, Collection<String> ignoredProperties, JsonPointerTracker jsonPointer)
-