/** * Returns the alt format that has been registered with the specified content * type. * * @param contentType type to look up. * @return registered format matching the type or {@code null}. */ public AltFormat lookupType(ContentType contentType) { // Do a direct lookup by media type first (fast) AltFormat format = typeMap.get(contentType.getMediaType()); if (format == null) { // If no match, use MIME type matching algorithm (slower but more precise) for (AltFormat testFormat : typeMap.values()) { if (contentType.match(testFormat.getContentType())) { format = testFormat; break; } } } if (format == null && delegate != null) { return delegate.lookupType(contentType); } return format; }
/** * Returns the alt format that has been registered with the specified content * type. * * @param contentType type to look up. * @return registered format matching the type or {@code null}. */ public AltFormat lookupType(ContentType contentType) { // Do a direct lookup by media type first (fast) AltFormat format = typeMap.get(contentType.getMediaType()); if (format == null) { // If no match, use MIME type matching algorithm (slower but more precise) for (AltFormat testFormat : typeMap.values()) { if (contentType.match(testFormat.getContentType())) { format = testFormat; break; } } } if (format == null && delegate != null) { return delegate.lookupType(contentType); } return format; }
/** * Returns the alt format that has been registered with the specified content * type. * * @param contentType type to look up. * @return registered format matching the type or {@code null}. */ public AltFormat lookupType(ContentType contentType) { // Do a direct lookup by media type first (fast) AltFormat format = typeMap.get(contentType.getMediaType()); if (format == null) { // If no match, use MIME type matching algorithm (slower but more precise) for (AltFormat testFormat : typeMap.values()) { if (contentType.match(testFormat.getContentType())) { format = testFormat; break; } } } if (format == null && delegate != null) { return delegate.lookupType(contentType); } return format; }
if (actualContentType.match(acceptedContentType)) { bestContentType = actualContentType; bestQ = curQ;
if (actualContentType.match(acceptedContentType)) { bestContentType = actualContentType; bestQ = curQ;
if (actualContentType.match(acceptedContentType)) { bestContentType = actualContentType; bestQ = curQ;