Thank you Jorg for coming back to me

well i just wrote a bit of the code, to give an example

you can see the full example in this link

https://docs.google.com/open?id=0B8TCL6GRojyLbzVYckZ2cEpWOUE

so you can navigate without downloading it

it is very small project 8kb.

I would greatly appreciated if you gave a look

Thank you in advance

Ruben

On Fri, Nov 16, 2012 at 8:03 PM, Jörg Schaible <[email protected]>wrote:

> Ruben Fragoso wrote:
>
> > Hello everyone
> >
> > i am trying to setup a custom marshal/unmarshal converter but i am
> getting
> > into some problems
> >
> > here is my context
> >
> > class MyValues {
> >
> >   private List<CommonType> myType
> >
> > }
> >
> > class MyType1 extends myType {
> > }
> >
> > class MyType2 extends myType{
> > }
> >
> > class  MyType3 extends myType  {
> >
> >  }
> >
> >
> > I can succesfully create this xml
> >
> > <myValues>
> >   <myType  type="type1"/>
> >   <myType  type="type2"/>
> >   <myType  type="type3"/>
> > </myValues>
> >
> >
> >
> >
> > but i am not successfully unmarshall, i tried to followed the several
> > tutorials but with out sucess, here is my code
> >
> >
> >   while (reader.hasMoreChildren()) {
> > if (reader.getAttribute("type").equals("type1")) {
> >                                          type ="type1";
> >                                 }
> >                                 if
> > (reader.getAttribute("type").equals("type2")) {
> >                                          type = "type2";
> >                                 }
> >   reader.moveDown();
> >                                 if (!reader.getValue().isEmpty()) {
> > if (!reader.getValue().isEmpty()) {
> >                                         if (type.equals("type1")) {
> >                                                  reader.moveUp();
> >                                                 wk = (MyType1)
> > uc.convertAnother(returnValue, MyType1.class);
> >                                                 reader.moveDown();
> >                                         }
> >
> >                                 }
> >   reader.moveUp();
> >
> >
> > The problem is that the object that i  get in return is completly empty?
> >
> > Could please let me know what is wrong my my code?
>
>
> Cannot say with this snippet, I don't know, which type your converter tries
> to handle - the list or the MyTypeX classes?. Show the complete code.
> However, none of your myType elements in the XML above have children nor
> text - so their *are* empty.
>
> - Jörg
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>

Reply via email to