You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Simon Moore <Si...@condisline.com> on 2003/01/16 19:05:41 UTC
RE: Where has commons lang Strings.interpolate(String text, Map m
ap) gone?
I don't want to spark off any arguments but was there any real strong reason
why it wasn't kept within commons.lang or at least moved to another package?
As you rightly suspected I don't want to add another dependancy as I'm using
this method in production.
I've had to add the method to our own string utils class :( ( I think it's
relative)
I suppose it went through the deprecation process?? ;)
Regards,
Saimon
> -----Mensaje original-----
> De: Henri Yandell [SMTP:bayard@generationjava.com]
> Enviado el: jueves 16 de enero de 2003 18:21
> Para: Jakarta Commons Developers List
> Asunto: Re: Where has commons lang Strings.interpolate(String text,
> Map map) gone?
>
>
> Yeah, they wouldn't let me keep it :(
>
> The method is in com.generationjava.util.Interpolator
> [http://www.generationjava.com/projects/GenJavaCore.shtml], or, as you
> probably won't want more dependencies, [and as GJ uses Namespace not Map]
> it ought to just be:
>
> static public String interpolate(String text, Map namespace) {
> Iterator keys = namespace.keySet().iterator();
> while(keys.hasNext()) {
> String key = keys.next().toString();
> Object obj = namespace.get(key);
> String value = obj.toString();
> text = StringUtils.replace(text, "${"+key+"}", value);
> if(key.indexOf(" ") == -1) {
> text = StringUtils.replace(text, "$"+key, value);
> }
> }
> return text;
> }
>
> Hope that helps,
>
> Hen
>
> On Thu, 16 Jan 2003 scolebourne@btopenworld.com wrote:
>
> > This method was removed for 1.0 due to its specific nature.
> >
> > Sorry.
> >
> > Stephen
> >
> > > from: Simon Moore <Si...@condisline.com>
> > > date: Thu, 16 Jan 2003 11:10:59
> > > to: commons-dev@jakarta.apache.org
> > > subject: Re: Where has commons lang Strings.interpolate(String text,
> Map map) gone?
> > >
> > > > I've been cleaning up some alod code dependant on commons-lang
> 0.1-dev to
> > > > depend on commons-lang 1.0 but I'm missing the
> > > > Strings.interpolate(String text, Map map) in StringUtils???
> > > >
> > > > Does anyone know where it went?
> > > >
> > > > Regards,
> > > >
> > > > Saimon
> > > >
> > > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Where has commons lang Strings.interpolate(String text, Map m
ap) gone?
Posted by Henri Yandell <ba...@generationjava.com>.
On Thu, 16 Jan 2003, Simon Moore wrote:
> I don't want to spark off any arguments but was there any real strong reason
> why it wasn't kept within commons.lang or at least moved to another package?
It moved to Commons Util, which was a sandboxed project, but that was
nuked recently. It had become a repository for unrelated and not very
important flotsam [in the general scheme of things].
The reason for moving it out of Commons.Lang is that there's a very big
worry that Commons Lang will grow too big and become Commons.Jakarta.JDK.
This manifests itself in two ways, firstly there is a definite push for
every class to justify its existence, and secondly there is an increasing
barrier to new concepts going in.
> I've had to add the method to our own string utils class :( ( I think it's
> relative)
> I suppose it went through the deprecation process?? ;)
Nope. Having deprecations from a beta to a first release seemed overkill.
I for one ought to make a good mental note of this case as I tend to not
be a believer in deprecation. I prefer to break it up front so that people
can solve it while the issues are still understood, and not in a year when
everyone's forgotten what the deal was. That's not a common view though at
Apache. This was definitely a case of the beta being 'cleaned' before
release.
Sorry about that,
Hen
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>