You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stephen Colebourne <sc...@btopenworld.com> on 2006/03/08 00:03:43 UTC

[lang] VariableFormatter and text package

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