Interface CharacterReplacer


public interface CharacterReplacer
Rule based (see getMap()) character replacer. Use getWriter(java.io.Writer) to create a filterd writer or processText(String) to apply these rules.
Since:
2.3
  • Method Summary

    Modifier and Type
    Method
    Description
    Return an unmodifiable containing all replacement rules of this character replacer.
    Short form for getWriter(out, false).
    getWriter(Writer out, boolean compressWhiteSpaces)
    Create a filtered writer which processes each character according to this replacement rules.
    Convinience method to replace all characters for which a replacement rule exist according to the matching replacement rule.
    Convinience method to replace all characters for which a replacement rule exist according to the matching replacement rule.
  • Method Details

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

      Return an unmodifiable containing all replacement rules of this character replacer.
      Since:
      2.3