|
From: Solomon D. <sd...@gm...> - 2013-08-23 13:53:56
|
XmlJavaAdapter is useful, but it's somewhat limited. You can use it for
things like converting Currency or Date objects into Strings and vice
versa. It's not all that helpful for more complicated scenarios, like
adding fields from a database or complicated XML conversions.
-Solomon
On Fri, Aug 23, 2013 at 9:48 AM, Adrian Mitev <adr...@gm...>wrote:
> Is there something like the XmlJavaAdapter in JAXB?
>
>
> On Fri, Aug 23, 2013 at 3:55 PM, Gregor Jarisch <gr...@ja...>wrote:
>
>> Hey Adrian,
>>
>> if you cannot/don't want to change it in the GET method directly but want
>> to deal with it at server side I would tunnel it..
>> Make a second Rest method, which calls your GET method via client api,
>> then change what you need to change and return the modified version to your
>> client.
>>
>> If your application is not a high performance app, this approach is a
>> good, clean choice..
>>
>> - Gregor
>>
>>
>> ------------------------------
>> *From: *"Adrian Mitev" <adr...@gm...>
>> *To: *res...@li...
>> *Sent: *Friday, August 23, 2013 2:02:41 PM
>> *Subject: *[Resteasy-developers] Converting object fields when
>> serializing to JSON
>>
>>
>> Hi all! I'm using the resteasy that comes with jboss 7.2 (EAP 6 alpha). I
>> have a @GET method that produces application/json where i return an object
>> (JPA entity) which contains a String field with the username of the user
>> who created the object. However on the client i need to provide more
>> information - username and full name. Is there a way to configure some kind
>> of converter so from:
>> class MyClass {
>> String title;
>> String username;
>> }
>> i should produce:
>> {
>> "title" : "something",
>> "username" : "amitev"
>> "fullname" : "Adrian Mitev"
>> }
>> or
>> {
>> "title" : "something",
>> "user" : {
>> "username" : "amitev"
>> "fullname" : "Adrian Mitev"
>> }
>> }
>>
>>
>> ------------------------------------------------------------------------------
>> Introducing Performance Central, a new site from SourceForge and
>> AppDynamics. Performance Central is your source for news, insights,
>> analysis and resources for efficient Application Performance Management.
>> Visit us today!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Resteasy-developers mailing list
>> Res...@li...
>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>>
>>
>
>
> ------------------------------------------------------------------------------
> Introducing Performance Central, a new site from SourceForge and
> AppDynamics. Performance Central is your source for news, insights,
> analysis and resources for efficient Application Performance Management.
> Visit us today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
>
|