org.openjena.atlas.web
Class AcceptList

java.lang.Object
  extended by org.openjena.atlas.web.AcceptList

public class AcceptList
extends Object


Constructor Summary
AcceptList(List<MediaRange> mediaRanges)
          Create a list of accept items from the give strings.
AcceptList(MediaRange... acceptItems)
          Create a list of accept items from the give MediaTypes.
AcceptList(String headerString)
          Parse an HTTP Accept (or etc) header string.
 
Method Summary
static AcceptList create(MediaType... acceptItems)
          Create a list of accept items from the give MediaTypes.
static AcceptList create(String... acceptStrings)
          Create a list of accept items from strings.
 MediaRange first()
           
static MediaType match(AcceptList proposalList, AcceptList offerList)
          Find the best thing in offer list with the proposal "best" means highest q value, with left most being better for same q.
 MediaRange match(MediaRange aItem)
          Find and return a match for a MediaRange
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AcceptList

public AcceptList(List<MediaRange> mediaRanges)
Create a list of accept items from the give strings.

Parameters:
mediaRanges -

AcceptList

public AcceptList(MediaRange... acceptItems)
Create a list of accept items from the give MediaTypes.

Parameters:
acceptItems -

AcceptList

public AcceptList(String headerString)
Parse an HTTP Accept (or etc) header string.

Parameters:
headerString -
Method Detail

create

public static AcceptList create(MediaType... acceptItems)
Create a list of accept items from the give MediaTypes.

Parameters:
acceptItems -

create

public static AcceptList create(String... acceptStrings)
Create a list of accept items from strings.

Parameters:
acceptStrings -

match

public MediaRange match(MediaRange aItem)
Find and return a match for a MediaRange


match

public static MediaType match(AcceptList proposalList,
                              AcceptList offerList)
Find the best thing in offer list with the proposal "best" means highest q value, with left most being better for same q.

Parameters:
proposalList - Client list of possibilities
offerList - Server list of possibilities
Returns:
MediaType

first

public MediaRange first()

toString

public String toString()
Overrides:
toString in class Object


Licenced under the Apache License, Version 2.0