commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29692] - [lang] String indentation feature request
Date Sun, 27 Jun 2004 04:06:19 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29692>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29692

[lang] String indentation feature request





------- Additional Comments From bayard@apache.org  2004-06-27 04:06 -------
Seems overly complex.

indentBlock(5) would just become replace("\n", "\n     "), or with a regex
solution, replace("^", "     "). It wouldn't understand the concept of blocks,
so would only ever indent by the same amount.

Still, I've done the same thing for a PrettyPrintXmlWriter, which I believe
takes care of the latter XML string idea:

http://www.osjava.org/xmlwriter/xref/com/generationjava/io/xml/PrettyPrinterXmlWriter.html

An IndentingWriter could be created using much the same idea and put in Commons
Lang or IO. IO as it would be a Writer, but StringWriter is hardly IO so there's
definitely a identity crisis there.

---------------------------------------------------------------------
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