Interface ICharacterEscaper

  • All Known Implementing Classes:
    ISO88591Escaper, USASCIIEscaper, UTF8Escaper

    public interface ICharacterEscaper
    Escaper for character data to be written to output document. This allows special character encodings to be handled appropriately on output. It's used by the generic output handler class during document marshalling.
    Version:
    1.0
    Author:
    Dennis M. Sosnoski
    • Method Detail

      • writeAttribute

        void writeAttribute​(String text,
                            Writer writer)
                     throws IOException
        Write attribute value with character entity substitutions. This assumes that attributes use the regular quote ('"') delimitor.
        Parameters:
        text - attribute value text
        writer - sink for output text
        Throws:
        IOException - on error writing to document
      • writeContent

        void writeContent​(String text,
                          Writer writer)
                   throws IOException
        Write content value with character entity substitutions.
        Parameters:
        text - content value text
        writer - sink for output text
        Throws:
        IOException - on error writing to document
      • writeCData

        void writeCData​(String text,
                        Writer writer)
                 throws IOException
        Write CDATA to document. This writes the beginning and ending sequences for a CDATA section as well as the actual text, verifying that only characters allowed by the encoding are included in the text.
        Parameters:
        text - content value text
        writer - sink for output text
        Throws:
        IOException - on error writing to document