public static final Parser withoutTypes(Parser parser, final Set<MediaType> excludeTypes) {
        return new ParserDecorator(parser) {
            private static final long serialVersionUID = 7979614774021768609L;

            @Override
            public Set<MediaType> getSupportedTypes(ParseContext context) {
                // Get our own, writable copy of the types the parser supports
                Set<MediaType> parserTypes =
                        new HashSet<>(super.getSupportedTypes(context));
                // Remove anything on our excludes list
                parserTypes.removeAll(excludeTypes);
                // Return whatever is left
                return parserTypes;
            }

            @Override
            public String getDecorationName() {
                return "Without Types";
            }
        };
    }
Decorates the given parser so that it never claims to support
parsing of the given media types, but will work for all others.

@param parser       the parser to be decorated
@param excludeTypes excluded/ignored media types
@return the decorated parser
tika-core/src/main/java/org/apache/tika/parser/ParserDecorator.java