de.espirit.firstspirit.client.common.text
Interface CharacterReplacer


public interface CharacterReplacer

Rule based (see CharacterReplacer.getMap()) character replacer. Use CharacterReplacer.getWriter(java.io.Writer) to create a filterd writer or CharacterReplacer.processText(String) to apply these rules.

Since:
2.3

Method Summary
 Map<CharContainer,String> getMap()
          Return an unmodifiable containing all replacement rules of this character replacer.
 Writer getWriter(Writer out)
          Short form for getWriter(out, false).
 Writer getWriter(Writer out, boolean compressWhiteSpaces)
          Create a filtered writer which processes each character according to this replacement rules.
 StringBuffer processText(CharSequence s)
          Convinience method to replace all characters for which a replacement rule exist according to the matching replacement rule.
 String processText(String s)
          Convinience method to replace all characters for which a replacement rule exist according to the matching replacement rule.
 

Method Detail

processText

String processText(String s)
Convinience method to replace all characters for which a replacement rule exist according to the matching replacement rule.

Since:
2.3
See Also:
CharacterReplacer.processText(CharSequence)

processText

StringBuffer processText(CharSequence s)
Convinience method to replace all characters for which a replacement rule exist according to the matching replacement rule.

Since:
4.0.17

getWriter

Writer getWriter(Writer out)
Short form for getWriter(out, false).

Since:
4.0.17

getWriter

Writer getWriter(Writer out,
                 boolean compressWhiteSpaces)
Create a filtered writer which processes each character according to this replacement rules. Characters without a replacement rule are written to out without conversion. In compressWhiteSpaces mode consecutive white spaces are replaced with one space character (for the definition of white space see Character.isWhitespace(char)).

Parameters:
out - writer where converted output is directed to
compressWhiteSpaces - In compressWhiteSpaces mode consecutive white spaces are replaced with one space.
Returns:
a filtered writer which delegates to the provided writer out
Since:
4.0.17

getMap

Map<CharContainer,String> getMap()
Return an unmodifiable containing all replacement rules of this character replacer.

Since:
2.3


Copyright © 2012 e-Spirit AG. All Rights Reserved. Build 4.2.480