Package com.ctc.wstx.api
Interface InvalidCharHandler
-
- All Known Implementing Classes:
InvalidCharHandler.FailingHandler,InvalidCharHandler.ReplacingHandler
public interface InvalidCharHandlerSimple converter interface designed to be used with stream writer propertyWstxOutputProperties.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 outXMLOutputFactory2.P_TEXT_ESCAPERinstead.Note about exceptions: choice of only allowing throwing of
IOExceptions is due to the way Woodstox stream writer backend works;XmlWritercan only throw IOExceptions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classInvalidCharHandler.FailingHandlerThis handler implementation just throws an exception for all invalid characters encountered.static classInvalidCharHandler.ReplacingHandlerAlternative to the default handler, this handler converts all invalid characters to the specified output character.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description charconvertInvalidChar(int invalidChar)
-
-
-
Method Detail
-
convertInvalidChar
char convertInvalidChar(int invalidChar) throws IOException- Throws:
IOException
-
-