public static HANDLER_TYPE parseHandlerType(String handlerTypeName, HANDLER_TYPE defaultType) {
        if (handlerTypeName == null) {
            return defaultType;
        }

        String lcHandlerTypeName = handlerTypeName.toLowerCase(Locale.ROOT);
        switch (lcHandlerTypeName) {
            case "xml":
                return HANDLER_TYPE.XML;
            case "text":
                return HANDLER_TYPE.TEXT;
            case "txt":
                return HANDLER_TYPE.TEXT;
            case "html":
                return HANDLER_TYPE.HTML;
            case "body":
                return HANDLER_TYPE.BODY;
            case "ignore":
                return HANDLER_TYPE.IGNORE;
            default:
                return defaultType;
        }
    }
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