On Thu, 26 Aug 2004, Gary Gregory wrote:
> Hello, > > I'm just taking a quick look at Interpolation. > > (1) Does it belong? > > I was at first a little surprised to see something so script-like in > [lang]. I guess it does not feel like something that is missing in > java.lang. OTOH, we are just talking about another form of String search > and replace, so it does make sense under that umbrella. Used to be a class in Util, but we didn't want it in Lang. Someone posted a patch for a similar thing for StringUtils and so I merged it in with the Util one and added it into Lang awaiting opinion. It's a pretty basic and common thing I think. > (2) The name Interpolation and interpolate. > > I must say that I am a bit turned off by these somewhat mathematical > names. This class is more of String "matcher" or "replacer" thingy. What > does Ant call these things? > > Interpolation.interpolate( templateString, valuesMap ); Perl/unix-y script calls it interpolating I think. That's why I've used that term :) > (3) Usage. > > I'd like that class to be more flexible in order to do the following for > example: > > Interpolation interpolation = new Interpolation(); > interpolation.setStartMarker("<"); > interpolation.setEndMarker(">"); > interpolation.setMap(aMap); > String news = interpolation.interpolate(templateString); Sounds interesting. ${..} seems a common default though. Hen --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]