public interface MappingGenerator
JsonGenerator to write JSON
To write JSON-P structure elements you can use the getJsonGenerator() method.| Modifier and Type | Method and Description |
|---|---|
javax.json.stream.JsonGenerator |
getJsonGenerator() |
MappingGenerator |
writeObject(Object o,
javax.json.stream.JsonGenerator generator)
Write the given Object o into the current JSON layer.
|
javax.json.stream.JsonGenerator getJsonGenerator()
JsonGenerator used internally to write the JSON output.MappingGenerator writeObject(Object o, javax.json.stream.JsonGenerator generator)
public 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"}
o - the object to writegenerator - the jsonp generator to useCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.