Hi Kevin,
protected void appendTextChunk(String text) { ... }
will work pretty well for me. Thanks. To make it a bit more flexible
just make it:
protected void appendTextChunk(CharSequence text) { ... }
then one can pass not only String, but also StringBuffer, StringBuilder, ...
On 29.05.2013 0:20, Kevin Day wrote:
> As far as exposing that field (either via protected field or a method), what
> happens when we do wind up changing from StringBuffer to StringBuilder
> (there are historical compatibility reasons for that selection, BTW - but
> they are ones that are going away). All of the sudden, we are making
> breaking changes in the API. Definitely no good - you wouldn't be very
> happy if that change in the future suddenly takes down your web service...
>
> An alternative that doesn't break encapsulation is to provide:
>
> protected void appendTextChunk(String text){}
>
>
> will that work for you?
>
> Note that if we had exposed the underlying string buffer directly, we would
> have broken encapsulation because StringBuffer isn't immutable. Allowing
> sub-classes to change the internal state of a parent class isn't a good
> idea, unless it's through a well defined interface that the parent knows
> about (i.e. appendTextChunk).
>
> Let me know if the above will be of use and I'll get it added for you - or
> propose an alternative and we can continue the discussion.
>
> Cheers,
>
> - K
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php