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 Summary

    Modifier and Type
    Method
    Description
    void
    writeAttribute(String text, Writer writer)
    Write attribute value with character entity substitutions.
    void
    writeCData(String text, Writer writer)
    Write CDATA to document.
    void
    writeContent(String text, Writer writer)
    Write content value with character entity substitutions.
  • Method Details

    • 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