public static Parser getParser(MediaType contentType) throws ParserNotFoundException {
        if (contentType == null) {
            throw new ParserNotFoundException("Content type not specified");
        }
        for (Map.Entry<MediaType, Parser> entry : available.entrySet()) {
            if (entry.getKey().isCompatible(contentType)) {
                return entry.getValue();
            }
        }

        throw new ParserNotFoundException(contentType, available.keySet());
    }
public static Parser getParser ( MediaType contentType ) throws ParserNotFoundException { if ( contentType == null ) { throw new ParserNotFoundException ( "Content type not specified" ) ; } for ( Map . Entry < MediaType , Parser > entry : available . entrySet ( ) ) { if ( entry . getKey ( ) . isCompatible ( contentType ) ) { return entry . getValue ( ) ; } } throw new ParserNotFoundException ( contentType , available . keySet ( ) ) ; }
@param contentType The accepted types
@return The {@link Parser} for the first match.
@throws ParserNotFoundException If parser is not found