On 27 Jan 2005, at 7:16 PM, Keith wrote:
OK, I took a quick look at the javadocs. The collection is the array of
GroupingAndChildrenNodesItem. So basically the GroupingAndChildrenNodes
class contains a collection of GroupingAndChildrenNodesItem. Each
GroupingAndChildrenNodesItem contains the choice component.
So the collection is there, Castor is basically giving you one extra
level of abstraction which you probably don't really need in your case,
but none-the-less your collection is there.
<light_bulb state="lit"/> ahhhhhhh now I get it... the extra layer was confusing me [easy to do]
Yes, you iterate through each item, getting the
GroupingAndChildrenNodesChoice contained within each. From there is
where it gets slightly ugly...you need to have an if-then-else statement
to check which value of the choice has been set:
ugly indeed
Castor could/should provide a more simple way of retrieving the value,
such as public Object getChoiceValue(); or something like that.[...] I feel that we
should have a way to get whatever value has been set, without needing to
loop through all the possibile getters.
I agree
Have you taken a look at the UnmarshalListener to see if that would work
for you? If not you can always get the stick a ContentHandler in-between
the parser and Castor's UnmarshalHandler (which implements both SAX 2.0
ContentHandler and SAX 1.0 DocumentHandler) to intercept all SAX events
and then forward them on to Castor's UnmarshalHandler for unmarshalling.
I will look at this approach... I'd rather avoid writing the whole ball-o-wax from scratch [which is why I am using Castor]
thanks very much for the help jeffs
-- Jeff Sonstein, Assistant Professor Department of Information Technology Rochester Institute of Technology ============================================== IT Dept Webspace: http://www.it.rit.edu/~jxs/ Blog: http://streamer.rit.edu/technobabble/ xVRML Project: http://www.xvrml.net/ Public Key: http://ariadne.iz.net/~jeffs/jeffs.asc Disclaimer: http://www.it.rit.edu/~jxs/emailDisclaimer.html
"there are no bugs
there are only undocumented features"
- [EMAIL PROTECTED] ------------------------------------------------------------ If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
