commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandor Murakozi <sandor.murak...@freemail.hu>
Subject [betwixt] Using interfaces as property types/ in collections
Date Thu, 03 Jun 2004 17:45:11 GMT
Hi all,

We use betwixt in our project, but we found a problem which
we couldn't solve with the actual implementation:

When a property is an interface type then the actual class
of the property instance is not saved to the xml -> when I
read it back the reader won't be able to instantiate it.
The same problem occurs if want a collection of interfaces.

I've checked the docs and the mailing lists, and seen that
some other guys has the same problem. 

I have 2 questions:

1. Is this problem already solved somehow? If it is, how?

2. If it isn't I have a proposal:

As a workaround I've implemented a subclass of
XMLIntrospector that saves the actual class as a property of
the element. A BeanCreator is able to create instances from
this representation, so if you add it to the bean creator
chain it solves both problems.

The functionality is working, but it still lacks some
polishing and documenting. If you are interested in it I can
finish it, and contribute it to the project.

The only ugly thing that my introspector contains a big copy
pasted method from the original one, so some refactoring
would be desirable in both classes.

Should I work on it and send a patch with the finished version?

Thanks,
don

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message