commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@eurobell.co.uk>
Subject [Betwixt] Some ideas
Date Thu, 13 Jun 2002 21:16:09 GMT
Hi,
A while back I looked at using Betwixt for my Bean to XML generation (Joda).
In the end I rolled my own (time pressure was a factor), but I would still
like to refactor Joda to use betwixt if possible in the longer term.

As you are talking about a 1.0 release, I thought I'd jot down some of the
ideas which I implemented in my Bean to XML code that aren't (yet) in
betwixt. Maybe some might make it to the todo list?

1) SAX outputter - I believe this is on the todo list already ;-)

2) ID's as Strings - Betwixt uses ints for it's ID/IDREF values (to handle
recursion). I needed Strings, to allow for more complex generated ids
including IP ref etc. This would be a faily easy change to make, but after a
release it would break backwards compatability?

3) ID's controlled on a per object basis - I created an Identifiable
interface with getIdentifier and setIdentifier methods. Those beans which
implemented it outputted an ID/IDREF. Those which didn't implement it were
output directly, with the potential for (the exception case) recursion.

4) Subclass handling - When I last looked, I could find no automatic
handling of class hierarchies. For example, the automatic generation of a
type attribute if the class being output is a subclass of that expected.

5) End of  line handling - I have read in the JDOM source code that the end
of line in XML documents must be \n on all systems. So should betwixt have
the setEndOfLine() method on BeanWriter?

Stephen


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


Mime
View raw message