Hi List,
 
In my Java object model, I have several objects (com.ge.tree.Oak,
com.ge.tree.Maple, com.ge.tree.Walnut, for example) that all use a
similar class com.ge.Wood for a field (lets call it woodType for this
example). When marshalling my XML out for this model, I would like to
change the name of the element that corresponds to the woodType field
depending on which subclass of com.ge.Wood the certain com.ge.tree class
uses.

In code:

class Oak implements com.ge.Tree {
   private Wood woodType = new OakWood();
}
class Maple implements com.ge.Tree {
   private Wood woodType = new MapleWood();
}
class Walnut implements com.ge.Tree {
   private Wood woodType = new WalnutWood();
}

In XML:
<oak>
   <oakWoodType specificGravity="142.2" />
</oak>
<maple>
   <mapleWoodType specificGravity="3.4"/>
</maple>
<walnut>
   <walnutWood specificGravity="123.4" />
</walnut>

At this point, my binding.xml file looks like this:

<mapping class="com.ge.Tree"
    abstract="true"
    marshaller="com.ge.CustomTreeMarshaller">
       <structure />
</mapping>

But it doesn't work.

Do you folks have any ideas or pointers?

Thanks!
Ian

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to