commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valerio Schiavoni <>
Subject Re: [digester] create parent from child node value
Date Tue, 20 Dec 2005 17:10:54 GMT
Hello Marco,
i've already considered that option, but it looks quite poor design to
provide so many setXXX methods on objects that will be initialized once and
Further, there are no restrictions to call those set methods after the
initialization of the object (that is, after the 0-param constructor is
used, either via a addObjectCreate or using addFactoryCreate), apart from
self-disciplined programmers.

What I mean is: how can I istantiate 'immutable' objects  that requires
values in their constructors ? None of the examples I found illustrate this
situation, so maybe this is voluntarly not supported by api designers. if
so, it'be interesting to understand why.


2005/12/20, Marco Mistroni <>:
> Hello,
>         I haven't used digester since some time (approx 1 year) , but I am
> not 100% sure
> That you can create Objects by passing parameters...
> At least in all examples that I have seen, all JB that were going to be
> Populated via Digester from XML had an empty constructor
> Will it be an option to use an empty constructor and call a  setXX method
> On your objects?
> Regards
>         marco
> -----Original Message-----
> From: Valerio Schiavoni []
> Sent: 20 December 2005 16:39
> To:
> Subject: [digester] create parent from child node value
> Hello,
> say I have this simple xml:
> <a>
>     <b>testB</b>
> </a>
> for any element 'a' a new object of type A must be istantiated, passing in
> it's 1-param constructor the value testB.
> Is this possible?
> thanks,
> valerio
> --
> To Iterate is Human, to Recurse, Divine
> James O. Coplien, Bell Labs
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To Iterate is Human, to Recurse, Divine
James O. Coplien, Bell Labs

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message