users@jaxb.java.net

Re: XML to Java Type Custom Binding

From: Felipe Gaúcho <fgaucho_at_gmail.com>
Date: Tue, 2 Sep 2008 13:41:10 +0200

you should created your own annotation.... because it is a custom mapping..

On Tue, Sep 2, 2008 at 1:40 PM, surajkumar <sasidharank_at_hcl.in> wrote:
>
> Thanks a lot for your reply.
>
> But the question is still unanswered. How do I tell the <annotations> that
> take the value from the 'ID' element and use it to name the properties for
> Java Type (Response) at run time, and simultaneously assign the value from
> the 'Value' element as the value to the properties.
>
> Right now I have the following output:
> Reponse[2]
> [0] id = "age"
> value = "10"
>
> [1] id="gender"
> value = "male"
>
> I want above to be like this now: If I am able to modify my annotations to
> do the following at run-time.
>
> Reponse[]
> age = "10"
> gender= "male"
>
> Any Idea, how I can achieve the above my modifying the annotations.
>
>
>
>
>
> Felipe Gaucho wrote:
>>
>> you can use XmlJavaTypeAdapter:
>>
>> http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html
>> http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/XML-to-Java-Type-Custom-Binding-tp19267669p19268573.html
> Sent from the java.net - jaxb users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>