Class RtfStringConverter

java.lang.Object
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfStringConverter

public final class RtfStringConverter extends Object

Converts java Strings according to RTF conventions.

This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).

  • Field Details

    • INSTANCE

      private static final RtfStringConverter INSTANCE
    • SPECIAL_CHARS

      private static final Map SPECIAL_CHARS
    • DBLQUOTE

      private static final Character DBLQUOTE
    • QUOTE

      private static final Character QUOTE
    • SPACE

      private static final Character SPACE
  • Constructor Details

    • RtfStringConverter

      private RtfStringConverter()
      singleton pattern
  • Method Details

    • getInstance

      public static RtfStringConverter getInstance()
      use this to get an object of this class
      Returns:
      the singleton instance
    • writeRtfString

      public void writeRtfString(Writer w, String str) throws IOException
      Write given String to given Writer, converting characters as required by RTF spec
      Parameters:
      w - Writer
      str - String to be written
      Throws:
      IOException - for I/O problems
    • escape

      public String escape(String str)
      Escapes a String as required by the RTF spec.
      Parameters:
      str - String to be escaped
      Returns:
      the escaped string