JAXB and JSONP - Java API for JSON Binding?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

JAXB and JSONP - Java API for JSON Binding?

Przemysław Bielicki
(sorry, forgot the subject in my previous email)

Hi,

I have a question to both groups (JAXB and JSONP).

You probably heard about EclipseLink MOXy project [1]. It is (among other features) another JAXB implementation. It is also possible to map JAXB annotated Java classes to and from JSON stream.

In JDK by default, there are two distinct projects to manage XML and JSON, namely JAXB-RI [2] and JSONP-RI [3] but they don't have anything in common. More so, there is no standard for mapping Java objects to JSON output (and the other way) - JSONP is the low-level API to serialize & deserialize JSON "by hand". The only way to do the Java-JSON binding is to use libraries like MOXy and it's default one for GlassFish [4].

Questions to JAXB leaders:
- Does this mean that MOXy is the default JAXB implementation used by GlassFish?
- Are there any plans to create a new JSR for Java-JSON binding e.g. Java API for JSON Binding?
- Are there any plans to include support for JSON marshalling & unmarshalling in JAXB (e.g. based on JAXB annotations)?

Questions to JSONP leaders:
- Are there any plans to include JSON validation (like XML schema validation)?
- If "yes" for the previous question - how do you want to define JSON schema - using JSON or XML Schema?

I would appreciate your feedback.

Cheers,
Przemyslaw Bielicki

[1] http://www.eclipse.org/eclipselink/moxy.php
[2] https://jaxb.java.net/
[3] https://jsonp.java.net
[4] http://java.dzone.com/articles/moxy-new-default-json-binding
Reply | Threaded
Open this post in threaded view
|

Re: JAXB and JSONP - Java API for JSON Binding?

Martin Grebac-2
Hi,

On 14/11/13 09:55, Przemysław Bielicki wrote:
> *Questions to JAXB leaders:*
> - Does this mean that MOXy is the default JAXB implementation used by
> GlassFish?
No, it is not, which does not say it may not become so in the future.
MOXy is the default implementation in latest versions of Weblogic though.

> - Are there any plans to create a new JSR for Java-JSON binding e.g.
> Java API for JSON Binding?
See Blaise's J1 talk where he discusses the submission:
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=3838

> - Are there any plans to include support for JSON marshalling &
> unmarshalling in JAXB (e.g. based on JAXB annotations)?
Are you asking for MOXy, RI, or the spec? We'll certainly consider this,
but no direct plans so far,

  MartiNG

> *Questions to JSONP leaders*:
> - Are there any plans to include JSON validation (like XML schema
> validation)?
> - If "yes" for the previous question - how do you want to define JSON
> schema - using JSON or XML Schema?
>
> I would appreciate your feedback.
>
> Cheers,
> Przemyslaw Bielicki
>
> [1] http://www.eclipse.org/eclipselink/moxy.php
> [2] https://jaxb.java.net/
> [3] https://jsonp.java.net
> [4] http://java.dzone.com/articles/moxy-new-default-json-binding

--
Martin Grebac, SW Engineering Manager (Metro/JAXWS/JAXB RI)
Oracle Czech, Prague
http://blogs.oracle.com/mgrebac

Reply | Threaded
Open this post in threaded view
|

Re: JAXB and JSONP - Java API for JSON Binding?

Przemysław Bielicki
Hi Martin,

thanks for your feedback.

- Are there any plans to include support for JSON marshalling & unmarshalling in JAXB (e.g. based on JAXB annotations)?
Are you asking for MOXy, RI, or the spec? We'll certainly consider this, but no direct plans so far,

I was asking about JAXB-RI.

I will follow up on Blaise's submission, then.

Are you guys working with him on this, or this will be a completely separate project with separate set of annotations, reference implementations, etc?

Ideal (IMHO) solution would be to have one set of annotations that would serve ANY serialization/deserialization protocol (including existing ones like Protocol Buffers [1], MessagePack [2], etc. as well as ones that will appear in the future). I really can't imagine different set of annotations for each protocol, can you? (well, I can, but would it be an elegant solution?)

Of course, each protocol would require a separate implementation. In the end the only difference between different protocols is what we send over the wire - the structure of the data is independent.
Thanks,
Przemyslaw


On Thu, Nov 14, 2013 at 2:00 PM, Martin Grebac <[hidden email]> wrote:
Hi,

On 14/11/13 09:55, Przemysław Bielicki wrote:
*Questions to JAXB leaders:*

- Does this mean that MOXy is the default JAXB implementation used by GlassFish?
No, it is not, which does not say it may not become so in the future. MOXy is the default implementation in latest versions of Weblogic though.


- Are there any plans to create a new JSR for Java-JSON binding e.g. Java API for JSON Binding?
See Blaise's J1 talk where he discusses the submission: https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=3838


- Are there any plans to include support for JSON marshalling & unmarshalling in JAXB (e.g. based on JAXB annotations)?
Are you asking for MOXy, RI, or the spec? We'll certainly consider this, but no direct plans so far,

 MartiNG

*Questions to JSONP leaders*:

- Are there any plans to include JSON validation (like XML schema validation)?
- If "yes" for the previous question - how do you want to define JSON schema - using JSON or XML Schema?

I would appreciate your feedback.

Cheers,
Przemyslaw Bielicki

[1] http://www.eclipse.org/eclipselink/moxy.php
[2] https://jaxb.java.net/
[3] https://jsonp.java.net
[4] http://java.dzone.com/articles/moxy-new-default-json-binding

--
Martin Grebac, SW Engineering Manager (Metro/JAXWS/JAXB RI)
Oracle Czech, Prague
http://blogs.oracle.com/mgrebac