private ContentHandler getFormatHandler() {
        switch (type) {
            case TEXT:
                return new ToTextContentHandler();
            case HTML:
                return new ToHTMLContentHandler();
            case XML:
                return new ToXMLContentHandler();
            default:
                return new ToTextContentHandler();
        }
    }
Tries to parse string into handler type.  Returns default if string is null or
parse fails.
<p/>
Options: xml, html, text, body, ignore (no content)

@param handlerTypeName string to parse
@param defaultType     type to return if parse fails
@return handler type
tika-core/src/main/java/org/apache/tika/sax/BasicContentHandlerFactory.java