commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <scolebou...@btopenworld.com>
Subject [lang] VariableFormatter and text package
Date Tue, 07 Mar 2006 23:03:43 GMT
This class is my main hold-up for release 2.2. Somehow, I just don't 
like it. It seems way complex for what it appears to do.

Thats a gut feel reaction however - I can't get my head around the code 
easily (another negative).

More specifically, there is no way to substitute the variables in a 
StrBuilder, which is kindof the point of the package.

I just wonder if we should rewrite the class much more simply, allowing 
it to operate on a StrBuilder. Isn't it just a loop through a map doing 
a search and replace on ${key} -> value ?

Not sure how others feel about the class.


The other item in the text package is StrBuilder.asTokenizer(). This 
method does not cuurrently actually link the tokenizer to the builder 
(as the writer/reader do). I think that what should happen is that the 
following sequence should work:

Create and populate StrBuilder
Call asTokenizer()
Tokenize
Add text to the builder*
Call StrTokenizer.reset()
Tokenize (and get results including added text*)

Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message