Way to map directly to/from JsonGenerator and JsonParser
Some data binding frameworks provide a way to do mappings to/from parsers and generator.
JAXB:
https://docs.oracle.com/javase/8/docs/api/javax/xml/bind/JAXB.html#unmarshal-javax.xml.transform.Source-java.lang.Class- https://docs.oracle.com/javase/8/docs/api/javax/xml/bind/JAXB.html#marshal-java.lang.Object-javax.xml.transform.Result-
(see StAXResult and StAXSource)
Jackson:
https://fasterxml.github.io/jackson-databind/javadoc/2.7/com/fasterxml/jackson/databind/ObjectMapper.html#writeValue(com.fasterxml.jackson.core.JsonGenerator,%20java.lang.Object) https://fasterxml.github.io/jackson-databind/javadoc/2.7/com/fasterxml/jackson/databind/ObjectMapper.html#readValues(com.fasterxml.jackson.core.JsonParser,%20java.lang.Class)
This is a useful feature as it allows a user to leverage the mapping rules without requiring a serialization format (JSON text or some other format). Also some implementations might only implement parser/generator and not implement JsonProvider.
Could we add to/from JSON methods for JsonParser and JsonGenerator?
See also: https://github.com/eclipse-ee4j/yasson/issues/245
Closing this item as a duplicate of #111
Based on the bug descriptions, these issues do not appear to be duplicates. Can you give an explanation or reopen this issue?
I had closed it as a duplicate because #111 refers to a similar type of bridge methods w/ JSON-P. I figured to/fromJsonStructure would be sufficient for users to bridge with JSON-P.
I suppose bridge methods with JsonGenerator/Parser would also have value, so I can re-open this issue.
See #224 for some discussion about why bridging to/from JsonStructure is insufficient. I missed this issue when I filed the new one, but @jjspiegel's original request is what I'm looking for as well.
Also, note that some work is likely necessary in JSON-P to make this work like JAXB or Jackson: https://github.com/eclipse-ee4j/jsonp/issues/233