sorry a small correction

class MyType1 extends CommonType {
}

class MyType2 extends CommonType{
}

class  MyType3 extends CommonType  {

 }



On Fri, Nov 16, 2012 at 6:15 PM, Ruben Fragoso <[email protected]>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?
>
> Thank you in advance
>
>
>
>

Reply via email to