Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/DesignDocs/405161

< EclipseLink‎ | DesignDocs
Revision as of 13:54, 25 November 2014 by Iaroslav.savytskyi.oracle.com (Talk | contribs) (Created page with "<div style="margin:5px;float:right;border:1px solid #000000;padding:5px">__TOC__</div> = MOXy support for for Java API for JSON Processing (JSR-353) = [https://bugs.eclipse.or...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MOXy support for for Java API for JSON Processing (JSR-353)

Bug 405161

Document History

Date Author Version Description & Notes
25.11.2015 Iaroslav Savytskyi Initial revision

Overview

JSR-353 specifies the way how JSON documents should be processing. Till now MOXy was using it's own JSON parser for this purpose. It's time for change. Providing support for JSR-353 MOXy allows customers to chose the JSON parser to be used based on their requirements (performance, memory, etc.). By default MOXy will use default implementation from https://jsonp.java.net.

Details

Unmarshal from javax.json.stream.JsonParser

Originally MOXy was created as JAXB implementation. And later JSON support was added. So unmarshalling JSON from the stream is not an easy task. Currently we are facing some problems with this and working on solution. As workaround we are parsing the whole JSON document and only after that processing it.

   try (
       InputStream inputStream = .....;
       JsonParser parser = Json.createParser(inputStream)
   ) {
       JsonParserSource source = new JsonParserSource(parser);
       Foo foo = context.getUnmarshaller().unmarshal(source, Foo.class);
   }

Unmarshal from javax.json.JsonStructure

Back to the top