commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Nakhla <>
Subject [BETWIXT] Betwixt, Interfaces, and Abstract Classes
Date Fri, 02 Dec 2005 19:38:30 GMT
I have a class, MyClass, that has a Collection property called myFooObjs.
The class may look like this:

public class MyClass {

   protected ArrayList myFooObjs = new ArrayList();

   public void addFooObj(Foo f) {
       ... (etc.) ...

   ..... (etc.) .....

Foo is an interface, and there is an abstract implementation of it,
AbstractFooImpl.  Below that, I have subclasses of AbstractFooImpl called
FooBar and FooFoo.

My problem is, how do I write a .betwixt file so that I can write a MyClass
object to XML and still be able to read it back with the appropriate FooBar
or FooFoo classes assigned?  What would the .betwixt file look like, and how
would Betwixt be able to determine which implementation of Foo is
appropriate (FooFoo or FooBar)?  I'm a bit puzzled as to how Betwixt handles
abstract classes and interfaces when writing or reading XML.  Can anyone
give me some examples of how this might work?  Thanks!

Steve Nakhla

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message