Package org.jboss.resteasy.core
Class MediaTypeMap<T>
java.lang.Object
org.jboss.resteasy.core.MediaTypeMap<T>
efficient MediaType index of T
- Version:
- $Revision: 1 $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static classprivate static classstatic interfaceprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<MediaTypeMap.Entry<T>> private Map<MediaTypeMap.CachedMediaTypeAndClass, List<T>> private static Patternstatic Patternprivate Map<String, MediaTypeMap.SubtypeMap<T>> static booleanBy default, MediaTypeMap will cache possible MediaType/Class matches.static Patternprivate List<MediaTypeMap.Entry<T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an object to the media type map.clone()private static <T> List<T> convert(List<MediaTypeMap.Entry<T>> list) getPossible(javax.ws.rs.core.MediaType accept) Returns a list of objects sorted based on their media type where the first in the list is the best matchgetPossible(javax.ws.rs.core.MediaType accept, Class<?> type)
-
Field Details
-
COMPOSITE_PATTERN
-
COMPOSITE_SUBTYPE_WILDCARD_PATTERN
-
WILD_SUBTYPE_COMPOSITE_PATTERN
-
index
-
wildcards
-
all
-
everything
-
classCache
-
useCache
public static boolean useCacheBy default, MediaTypeMap will cache possible MediaType/Class matches. Set this to false to turn off caching
-
-
Constructor Details
-
MediaTypeMap
public MediaTypeMap()
-
-
Method Details
-
clone
-
getClassCache
-
add
Add an object to the media type map. This is synchronized to serialize adds.- Parameters:
type-obj-
-
convert
-
getPossible
Returns a list of objects sorted based on their media type where the first in the list is the best match- Parameters:
accept- mime to match- Returns:
-
getPossible
-