commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin van den Bemt <>
Subject [Fwd: Re: [betwixt] info on .betwixt files, "add" methods, and CyclicReferenceExceptions]
Date Mon, 09 Dec 2002 12:30:36 GMT
Wtf.. The reply didn't get to the list..


-----Forwarded Message-----

From: Martin van den Bemt <>
Subject: Re: [betwixt] info on .betwixt files, "add" methods, and CyclicReferenceExceptions
Date: 09 Dec 2002 13:24:02 +0100

On Sat, 2002-12-07 at 21:10, Darren Scott wrote:
> I'm just starting to use betwixt for serializing beans to XML for later
> transformation into XHTML using XSLT. Things are generally working OK so
> far, although getting it to work was a lot of trial and error
> (particularly because I couldn't find good information about how to use
> the .betwixt files anywhere!).
> Can anyone please answer the following questions:
> 1) Is there a complete reference for how to use .betwixt files? I've
> seen the overview and FAQ betwixt project pages, but nothing else in
> detail.

Not there isn't (besides digging into the sourcecode and trial & error).
We have to do something about this.. One note : a .betwixt is only for
the bean the .betwixt file is for. So if you use a Person bean which
also contains an Address beean, Person.betwixt cannot be used to alter
the address behaviour. (or at least doesn't give the required results..)

> 2) How does betwixt use "add" methods exactly? What use are they to
> betwixt? What relation do they have to the "get" methods?

add is called when the getter returns a collection. 

> 3) I seem to get CyclicReferenceExceptions when I don't expect to. Maybe
> it's my misunderstanding of what a graph cycle is, but I took it to mean
> when you get into an infinite cycle with references e.g. A refers to B,
> B refers to C, C refers to A, A refers to B etc. I get these exceptions
> raised when I have a collection containing multiple references to the
> same object. I wouldn't have expected this situation to be treated as a
> cycle.

The cyclic checking isn't that advanced yet. The scenario that A refers
to another A is covered however. Since the cyclic stuff also has some
relation when you use id's (and I am not into id's that much), I
probably have to have some help with the id handling.
Time to read some specs on that :)

I'll will try to answer your questions in more details by updating the
docs, which will describe the correct behaviour


View raw message