Interface InvalidCharHandler

  • All Known Implementing Classes:
    InvalidCharHandler.FailingHandler, InvalidCharHandler.ReplacingHandler

    public interface InvalidCharHandler
    Simple converter interface designed to be used with stream writer property WstxOutputProperties.P_OUTPUT_INVALID_CHAR_HANDLER. The idea is that it should be easy to have a way to convert invalid characters such as Ascii control characters into something that is legal to include in XML content. This only allows for simple char-by-char replacements, instead of something more advanced such as escaping. If escaping is needed, check out XMLOutputFactory2.P_TEXT_ESCAPER instead.

    Note about exceptions: choice of only allowing throwing of IOExceptions is due to the way Woodstox stream writer backend works; XmlWriter can only throw IOExceptions.