public interface Replacer
Modifier and Type | Method and Description |
---|---|
boolean |
expectsPlainText()
If a replacer expects plain text strings, then html content is
automatically unescaped.
|
void |
replace(java.lang.StringBuilder target,
java.lang.String piece)
Actual replace operation.
|
boolean expectsPlainText()
void replace(java.lang.StringBuilder target, java.lang.String piece)
expectsPlainText()
) and the result should be written to
target. If nothing gets written to target then that
piece of text is lost, so the replacer has full control of the
transformation of that particular piece of text.
If expectsPlainText()
returns true, then replace is
called with a piece of plain text. If expectsPlainText() returns
false, then a piece of HTML content is provided. In both cases the
replacer is expected to write HTML content into target.
Note that the replacer has to do appropriate HTML escaping itself when necessary, because we cannot determine the nature of the replacer's specific implementation.
target
- the target buffer to write the result topiece
- the piece of text that can be replaced
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.