On Wed, 20 Nov 2002 07:26, Leandro Rodrigo Saad Cruz wrote: > On Tue, 2002-11-05 at 22:02, Peter Donald wrote: > > On Wed, 6 Nov 2002 08:15, Leandro Rodrigo Saad Cruz wrote: > > > I know DefaultConfiguration has a method called addChild(), but to use > > > this , I have to build my new Configuration instance from the ground, > > > possibly keeping track of differences between instances, etc ,etc. > > > Is there any faster/easier way to change Configuration objects ? > > > > Not really. Most of the way we recomend doing it is by reading it from > > xml (or from SAX generated vis xslt or similar). > > I think that we should be able to insert configuration fragments at > specific positions ( to isolate configuration changes ), something like > addChildAt(int pos, Configuration conf). > and to be able to know the position os a Configuration object in its > Configuration tree. Do you think this is a general need or just mine ?
I think it is a general need but I am not sure that Configuration is the right place to do it. Configuration was designed as a read-only object that could be exposed to components without the component modifying it. It may be a good idea to edit the object using another DOM object model (JDOM, DOM4J, W3C Dom etc). Then convert that DOM model to a configuration tree. Thoughts? BTW If you choose W3C DOM the avalon.framework.configuration.ConfigurationUtil has a toElement() method on that converts a config tree to a w3c DOM tree. Another method that converts a DOM tree to a Configuration tree could be easily added if you wanted/ -- Cheers, Peter Donald ----------------------------------------------- | If you turn on the light quickly enough, | | you can see what the dark looks like. | ----------------------------------------------- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>