RESTEasy JAX-RS Implementation 2.3.6.Final-redhat-1

org.jboss.resteasy.core
Class MediaTypeMap<T>

java.lang.Object
  extended by org.jboss.resteasy.core.MediaTypeMap<T>

public class MediaTypeMap<T>
extends Object

efficient MediaType index of T

Version:
$Revision: 1 $
Author:
Bill Burke

Nested Class Summary
static class MediaTypeMap.CachedMediaTypeAndClass
           
static interface MediaTypeMap.Typed
           
 
Field Summary
static Pattern COMPOSITE_SUBTYPE_WILDCARD_PATTERN
           
static boolean useCache
          By default, MediaTypeMap will cache possible MediaType/Class matches.
static Pattern WILD_SUBTYPE_COMPOSITE_PATTERN
           
 
Constructor Summary
MediaTypeMap()
           
 
Method Summary
 void add(javax.ws.rs.core.MediaType type, T obj)
           
 Map<MediaTypeMap.CachedMediaTypeAndClass,List<T>> getClassCache()
           
 List<T> 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 match
 List<T> getPossible(javax.ws.rs.core.MediaType accept, Class type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPOSITE_SUBTYPE_WILDCARD_PATTERN

public static Pattern COMPOSITE_SUBTYPE_WILDCARD_PATTERN

WILD_SUBTYPE_COMPOSITE_PATTERN

public static Pattern WILD_SUBTYPE_COMPOSITE_PATTERN

useCache

public static boolean useCache
By default, MediaTypeMap will cache possible MediaType/Class matches. Set this to false to turn this off.

Constructor Detail

MediaTypeMap

public MediaTypeMap()
Method Detail

getClassCache

public Map<MediaTypeMap.CachedMediaTypeAndClass,List<T>> getClassCache()

add

public void add(javax.ws.rs.core.MediaType type,
                T obj)

getPossible

public List<T> 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 match

Parameters:
accept - mime to match
Returns:

getPossible

public List<T> getPossible(javax.ws.rs.core.MediaType accept,
                           Class type)

RESTEasy JAX-RS Implementation 2.3.6.Final-redhat-1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.