@Override
    public ContentHandler getNewContentHandler() {

        if (type == HANDLER_TYPE.BODY) {
            return new BodyContentHandler(
                    new WriteOutContentHandler(new ToTextContentHandler(), writeLimit,
                    throwOnWriteLimitReached, parseContext));
        } else if (type == HANDLER_TYPE.IGNORE) {
            return new DefaultHandler();
        }
        ContentHandler formatHandler = getFormatHandler();
        if (writeLimit < 0) {
            return formatHandler;
        }
        return new WriteOutContentHandler(formatHandler, writeLimit, throwOnWriteLimitReached,
                parseContext);
    }
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