I honestly cannot think of any "easy" way to do this short of using the
xml:anyAttribute type things to have a map of attributes on the JAXB types and
fill those in. Kind of crappy.
The only other way I can think of is to write a XMLStreamWriter that would
wrapper the other and trap the "key" and "value" elements and not pass them up
as is and remap them.
Dan
On Friday 02 July 2010 7:39:10 am londonB wrote:
> Hi all,
>
> I've been trying to represent a Json using CXF. The actual piece of Json
> looks like the example below :
>
> [CODE]
> .
> .
> .
> "example":{
> "key":"test1",
> "value":"test2"
> },
> .
> .
> .
> [/CODE]
>
> The problem is that I would like to represent the above example like the
> following:
>
> [CODE]
> .
> .
> .
> "example":{
> "test1":"test2",
> },
> .
> .
> .
> [/CODE]
>
> where "test1" and "test2" are respectively the two properties "key" and
> "value" which I had defined in the bean.
> I dont know how populate the two properties in order to obtain a result
> like the second example above.
> Does anyone know how can I do it? I'm out of ideas.
>
> Thank you very much.
--
Daniel Kulp
[email protected]
http://dankulp.com/blog