-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Way to map directly to/from JsonGenerator and JsonParser #122
Comments
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: jakartaee/jsonp-api#233 |
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: eclipse-ee4j/yasson#245
The text was updated successfully, but these errors were encountered: