org.jboss.resteasy.util
Class MediaTypeHelper

java.lang.Object
  extended by org.jboss.resteasy.util.MediaTypeHelper

public class MediaTypeHelper
extends java.lang.Object

Version:
$Revision: 1 $
Author:
Bill Burke

Constructor Summary
MediaTypeHelper()
           
 
Method Summary
static int compareWeight(MediaType one, MediaType two)
           
static boolean equivalent(MediaType m1, MediaType m2)
           
static boolean equivalentParams(MediaType m1, MediaType m2)
           
static MediaType getBestMatch(java.util.List<MediaType> desired, java.util.List<MediaType> provided)
           
static MediaType getConsumes(java.lang.Class declaring, java.lang.reflect.AccessibleObject method)
           
static MediaType getProduces(java.lang.Class declaring, java.lang.reflect.Method method)
           
static float getQ(MediaType type)
           
static float getQWithParamInfo(MediaType type)
           
static boolean isComposite(java.lang.String subtype)
           
static boolean isCompositeWildcardSubtype(java.lang.String subtype)
          subtypes like application/*+xml
static boolean isWildcardCompositeSubtype(java.lang.String subtype)
          subtypes like application/*+xml
static java.util.List<MediaType> parseHeader(java.lang.String header)
           
static boolean sameWeight(MediaType one, MediaType two)
           
static void sortByWeight(java.util.List<MediaType> types)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaTypeHelper

public MediaTypeHelper()
Method Detail

getConsumes

public static MediaType getConsumes(java.lang.Class declaring,
                                    java.lang.reflect.AccessibleObject method)

getProduces

public static MediaType getProduces(java.lang.Class declaring,
                                    java.lang.reflect.Method method)

getQ

public static float getQ(MediaType type)

getQWithParamInfo

public static float getQWithParamInfo(MediaType type)

isCompositeWildcardSubtype

public static boolean isCompositeWildcardSubtype(java.lang.String subtype)
subtypes like application/*+xml

Parameters:
subtype -
Returns:

isWildcardCompositeSubtype

public static boolean isWildcardCompositeSubtype(java.lang.String subtype)
subtypes like application/*+xml

Parameters:
subtype -
Returns:

isComposite

public static boolean isComposite(java.lang.String subtype)

compareWeight

public static int compareWeight(MediaType one,
                                MediaType two)

sameWeight

public static boolean sameWeight(MediaType one,
                                 MediaType two)

sortByWeight

public static void sortByWeight(java.util.List<MediaType> types)

getBestMatch

public static MediaType getBestMatch(java.util.List<MediaType> desired,
                                     java.util.List<MediaType> provided)

parseHeader

public static java.util.List<MediaType> parseHeader(java.lang.String header)

equivalent

public static boolean equivalent(MediaType m1,
                                 MediaType m2)

equivalentParams

public static boolean equivalentParams(MediaType m1,
                                       MediaType m2)


Copyright © 2010. All Rights Reserved.