commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lance Semmens <lance.semm...@essential.com.au>
Subject RE: [betwixt] Custom bean creation
Date Mon, 18 Apr 2005 23:19:15 GMT
> i can give you some instructions about how you can solve your the
> problem in the narrow
I'd appreciate it if you would.. thanks

> or (if you feel like contributing to betwixt), we
> can talk about ways to solve this problem in the general :)
Given my current work commitments there are not enough hours in the day..
sorry.

Lance.

-----Original Message-----
From: robert burrell donkin
[mailto:robertburrelldonkin@blueyonder.co.uk]
Sent: Tuesday, 19 April 2005 5:40 AM
To: Jakarta Commons Users List
Subject: Re: [betwixt] Custom bean creation
Importance: Low


On Mon, 2005-04-18 at 15:05 +0930, Lance Semmens wrote:
> I'm wanting to use my own logic to instantiate beans from XML elements.
> After reading the doco, it seems that the way to do this is to create a
> ChainedBeanCreator and add it to the BeanCreationChain.
> 
> I am writing my own ChainedBeanCreator but I can't see how to access the
> body of an XML element in the 
> create(ElementMapping mapping, ReadContext context, BeanCreationChain
chain)
> method. 
> 
> When i say "the body of an xml element" i mean "bar" part of
> "<foo>bar</foo>".

betwixt is sax-based. this has several implications for the
architecture. the bean creation chain stuff is intended to help solve
the problem of what object to create when faced with the initial element
info set. this would allow you to do something clever when faced with
the element <foo>. however, being SAX, you cannot read forward to find
out what the mixed content (for example 'bar') is.

a different mechanism is therefore required to support object creation
based on mixed content (or indeed, full info set). this is something
that i've wanted to add for a long time and have a good idea how to do
it but i'm unlikely to get it done any time soon. (my main priority at
the moment is fixing commons-logging which is difficult and that may
take quite a while.)

i can give you some instructions about how you can solve your the
problem in the narrow or (if you feel like contributing to betwixt), we
can talk about ways to solve this problem in the general :)

i'll leave it up to you... 

- robert 


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

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


Mime
View raw message