org.glassfish.jersey.message.internal
Class VariantSelector

java.lang.Object
  extended by org.glassfish.jersey.message.internal.VariantSelector

public final class VariantSelector
extends Object

Utility for selecting variant that best matches request from a list of variants.

Author:
Paul Sandoz, Marek Potociar (marek.potociar at oracle.com)

Method Summary
static Variant selectVariant(InboundMessageContext context, List<Variant> variants, Ref<String> varyHeaderValue)
          Select the representation variant that best matches the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

selectVariant

public static Variant selectVariant(InboundMessageContext context,
                                    List<Variant> variants,
                                    Ref<String> varyHeaderValue)
Select the representation variant that best matches the request. More explicit variants are chosen ahead of less explicit ones.

Parameters:
context - inbound message context.
variants - list of possible variants.
varyHeaderValue - an output reference of vary header value that should be put into the response Vary header.
Returns:
selected variant.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.