commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <>
Subject Re: [lang] text.Interpolation, on to 2.2
Date Sat, 09 Jul 2005 13:32:28 GMT
>> a) we don't have the ability to call it directly from StrBuilder 
>> without copying the char array to a String. (VariableFormatter needs 
>> rewriting to operate on a char[])

Hmmm. I've just realised that this won't work. VariableFormatter may 
need to lengthen the array, and that isn't possible outside the 
StrBuilder class (without horrible hacks).

So, IMHO, we need to focus on StrBuilder again. StrBuilder is intended 
as our mutable string. VariableFormatter can use a StrBuilder intenally.

StrTokenizer doen't need to use StrBuilder as it doesn't change the 
string. VariableFormatter does change the string, so should be built on 

Oliver Heger wrote:
> I think, it shouldn't be a problem to implement the 
> Matcher interface to locate variables in the source string. But I will 
> have to study the StrTokenizer class whether it is possible to extract 
> the variables' names once they have been detected.

My point wrt StrTokenizer was that the Matcher interface *might* be 
useful. However, on further reflection, I think it is best to keep the 
two classes a bit more separate. We shouldn't force re-use.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message