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