Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351588 - JSON Unmarshal - support for namespaces
Summary: JSON Unmarshal - support for namespaces
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Denise Smith CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-08 11:04 EDT by Denise Smith CLA
Modified: 2022-06-09 10:05 EDT (History)
2 users (show)

See Also:


Attachments
Proposed changes and tests (47.19 KB, patch)
2011-07-27 15:54 EDT, Denise Smith CLA
no flags Details | Diff
Updated support for users to supply a Map of prefix/uris (47.19 KB, patch)
2011-09-08 15:18 EDT, Denise Smith CLA
no flags Details | Diff
Updated support for users to supply a Map of prefix/uris (54.29 KB, patch)
2011-09-08 15:19 EDT, Denise Smith CLA
no flags Details | Diff
Updated support for users to supply a Map of prefix/uris (59.09 KB, patch)
2011-09-08 15:37 EDT, Denise Smith CLA
no flags Details | Diff
Updated support for users to supply a Map of prefix/uris (58.69 KB, patch)
2011-09-08 16:40 EDT, Denise Smith CLA
no flags Details | Diff
Update patch after review (60.21 KB, patch)
2011-09-09 10:48 EDT, Denise Smith CLA
no flags Details | Diff
Updated patch after review (60.28 KB, patch)
2011-09-09 13:57 EDT, Denise Smith CLA
no flags Details | Diff
Updated changes (27.52 KB, patch)
2012-02-09 15:54 EST, Denise Smith CLA
no flags Details | Diff
Updated changes - test cases (40.87 KB, patch)
2012-02-09 15:56 EST, Denise Smith CLA
no flags Details | Diff
Updated changed to make use of namespace prefix mapper code (74.18 KB, patch)
2012-02-14 13:28 EST, Denise Smith CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Denise Smith CLA 2011-07-08 11:04:05 EDT
In JSON there is no concept of namespaces so if the meta-data has namespaces they will not get written to JSON during marshal.   During unmarshal we need a way to compare the meta-data to the fields based just on local name, ignoring the namespace.
Comment 1 Denise Smith CLA 2011-07-27 15:54:19 EDT
Created attachment 200473 [details]
Proposed changes and tests
Comment 2 Denise Smith CLA 2011-09-08 15:18:52 EDT
Created attachment 203021 [details]
Updated support for users to supply a Map of prefix/uris
Comment 3 Denise Smith CLA 2011-09-08 15:19:31 EDT
Created attachment 203022 [details]
Updated support for users to supply a Map of prefix/uris
Comment 4 Denise Smith CLA 2011-09-08 15:37:02 EDT
Created attachment 203023 [details]
Updated support for users to supply a Map of prefix/uris
Comment 5 Denise Smith CLA 2011-09-08 16:40:31 EDT
Created attachment 203032 [details]
Updated support for users to supply a Map of prefix/uris
Comment 6 Denise Smith CLA 2011-09-09 10:48:56 EDT
Created attachment 203066 [details]
Update patch after review
Comment 7 Denise Smith CLA 2011-09-09 13:57:33 EDT
Created attachment 203081 [details]
Updated patch after review
Comment 8 Denise Smith CLA 2012-02-09 15:54:59 EST
Created attachment 210824 [details]
Updated changes
Comment 9 Denise Smith CLA 2012-02-09 15:56:06 EST
Created attachment 210826 [details]
Updated changes - test cases
Comment 10 Denise Smith CLA 2012-02-14 13:28:12 EST
Created attachment 210997 [details]
Updated changed to make use of namespace prefix mapper code
Comment 11 Denise Smith CLA 2012-02-14 13:30:13 EST
Checked in support for marshal and unmarshal of namespaces in JSON.    To set unmarshal namespaces use:
 Map namespaces = new HashMap<String, String>();
 namespaces.put("namespace1", "ns1");
 namespaces.put("namespace2", "ns2");
 jsonUnmarshaller.setProperty(JAXBContext.JSON_NAMESPACE_PREFIX_MAPPER, namespaces);

And on the marshaller
jsonMarshaller.setProperty(JAXBContext.NAMESPACE_PREFIX_MAPPER, namespaces)
Comment 12 Eclipse Webmaster CLA 2022-06-09 10:05:33 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink