/** * Searches the group for a parser that can handle the specified <l>Content-Type</l> header value. * * <p> * The returned object includes both the parser and media type that matched. * * @param contentTypeHeader The HTTP <l>Content-Type</l> header value. * @return The parser and media type that matched the content type header, or <jk>null</jk> if no match was made. */ public ParserMatch getParserMatch(String contentTypeHeader) { ParserMatch pm = cache.get(contentTypeHeader); if (pm != null) return pm; ContentType ct = ContentType.forString(contentTypeHeader); int match = ct.findMatch(mediaTypes); if (match >= 0) { pm = new ParserMatch(mediaTypes[match], mediaTypeParsers[match]); cache.putIfAbsent(contentTypeHeader, pm); } return cache.get(contentTypeHeader); }
/** * Searches the group for a parser that can handle the specified <l>Content-Type</l> header value. * * <p> * The returned object includes both the parser and media type that matched. * * @param contentTypeHeader The HTTP <l>Content-Type</l> header value. * @return The parser and media type that matched the content type header, or <jk>null</jk> if no match was made. */ public ParserMatch getParserMatch(String contentTypeHeader) { ParserMatch pm = cache.get(contentTypeHeader); if (pm != null) return pm; ContentType ct = ContentType.forString(contentTypeHeader); int match = ct.findMatch(mediaTypes); if (match >= 0) { pm = new ParserMatch(mediaTypes[match], mediaTypeParsers[match]); cache.putIfAbsent(contentTypeHeader, pm); } return cache.get(contentTypeHeader); }
/** * Returns the parser and media type matching the request <code>Content-Type</code> header. * * @return * The parser matching the request <code>Content-Type</code> header, or <jk>null</jk> if no matching parser was * found. * Includes the matching media type. */ public ParserMatch getParserMatch() { if (mediaType != null && parser != null) return new ParserMatch(mediaType, parser); MediaType mt = getMediaType(); return mt == null ? null : parsers.getParserMatch(mt); }
/** * Searches the group for a parser that can handle the specified <l>Content-Type</l> header value. * * <p> * The returned object includes both the parser and media type that matched. * * @param contentTypeHeader The HTTP <l>Content-Type</l> header value. * @return The parser and media type that matched the content type header, or <jk>null</jk> if no match was made. */ public ParserMatch getParserMatch(String contentTypeHeader) { ParserMatch pm = cache.get(contentTypeHeader); if (pm != null) return pm; ContentType ct = ContentType.forString(contentTypeHeader); int match = ct.findMatch(mediaTypes); if (match >= 0) { pm = new ParserMatch(mediaTypes[match], mediaTypeParsers[match]); cache.putIfAbsent(contentTypeHeader, pm); } return cache.get(contentTypeHeader); }
/** * Returns the parser and media type matching the request <code>Content-Type</code> header. * * @return * The parser matching the request <code>Content-Type</code> header, or <jk>null</jk> if no matching parser was * found. * Includes the matching media type. */ public ParserMatch getParserMatch() { if (mediaType != null && parser != null) return new ParserMatch(mediaType, parser); MediaType mt = getMediaType(); return mt == null ? null : parsers.getParserMatch(mt); }
/** * Returns the parser and media type matching the request <code>Content-Type</code> header. * * @return * The parser matching the request <code>Content-Type</code> header, or <jk>null</jk> if no matching parser was * found. * Includes the matching media type. */ public ParserMatch getParserMatch() { if (mediaType != null && parser != null) return new ParserMatch(mediaType, parser); MediaType mt = getMediaType(); return mt == null ? null : parsers.getParserMatch(mt); }