Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353938

Summary: JSON - No root element handling
Product: z_Archived Reporter: Denise Smith <denise.mahar>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.oxm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed changes and tests
none
Updated INCLUDE_ROOT option
none
Update - INCLUDE_ROOT option none

Description Denise Smith CLA 2011-08-04 16:01:26 EDT
In JSON a document can look like this 
{"address"
  {"street":"theStreet",
  "city":"theCity"
  }
}

Or it can exist with no root (in this case no "address")
 {"street":"theStreet",
  "city":"theCity"
  }

We need to be able to unmarshal this.  Since we'll need to provide the class to unmarshal to the object returned will be a JAXBElement (see that JAXBUnmarshaller.unmarshal(Source) returns a JAXBElement).  In this case the QName on the JAXBElement will have an "" local name.  In the marshal case if a QName on a JAXBElement has an "" local name we will treat it as not having a root element.
Comment 1 Denise Smith CLA 2011-08-04 16:28:44 EDT
Created attachment 200943 [details]
Proposed changes and tests
Comment 2 Denise Smith CLA 2011-08-10 11:01:52 EDT
Checked changes in to trunk.  Behavior as described in the bug.
Comment 3 Denise Smith CLA 2011-09-29 14:32:04 EDT
Created attachment 204317 [details]
Updated INCLUDE_ROOT option
Comment 4 Denise Smith CLA 2011-09-29 15:15:21 EDT
Created attachment 204321 [details]
Update - INCLUDE_ROOT option
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:36:15 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink