Package org.jboss.resteasy.core
Class MediaTypeMap<T>
java.lang.Object
org.jboss.resteasy.core.MediaTypeMap<T>
A copy-on-write MediaType index of T.
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMediaTypeMap(MediaTypeMap<T> mediaTypeMap) Shallow copy, any additional adds will deep copy -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an object to the media type map.voidAdd an object to the media type map.protected voidvoidaddCompositeWild(jakarta.ws.rs.core.MediaType mediaType, T obj, String baseSubtype) voidaddRegular(jakarta.ws.rs.core.MediaType mediaType, T obj) voidaddWildcard(T obj) voidaddWildComposite(jakarta.ws.rs.core.MediaType mediaType, T obj, String baseSubtype) voidaddWildSubtype(jakarta.ws.rs.core.MediaType mediaType, T obj) static StringcompositeWildSubtype(String subtype) getPossible(jakarta.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(jakarta.ws.rs.core.MediaType accept, Class<?> type) voidAfter this is called, all new adds will deep copy itself.static StringwildCompositeSubtype(String subtype)
-
Field Details
-
COMPOSITE_SUBTYPE_WILDCARD_PATTERN
-
WILD_SUBTYPE_COMPOSITE_PATTERN
-
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() -
MediaTypeMap
Shallow copy, any additional adds will deep copy- Parameters:
mediaTypeMap-
-
-
Method Details
-
compositeWildSubtype
-
wildCompositeSubtype
-
lockSnapshots
public void lockSnapshots()After this is called, all new adds will deep copy itself. -
add
Add an object to the media type map. This is synchronized to serialize adds.- Parameters:
type- media typeobj- object
-
add
Add an object to the media type map. This is synchronized to serialize adds.- Parameters:
mediaType- media typeobj- object
-
addWildcard
-
add
-
addRegular
-
addCompositeWild
-
addWildComposite
-
addWildSubtype
-
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:
- list of objects
-
getPossible
-