org.openrdf.http.object.util
Class Accepter

java.lang.Object
  extended by org.openrdf.http.object.util.Accepter

public class Accepter
extends Object

Collection of Accept header entries.

Author:
James Leigh

Constructor Summary
Accepter()
           
Accepter(Collection<MimeType> mediaTypes)
           
Accepter(String... mediaTypes)
           
Accepter(String accept)
           
 
Method Summary
 void addMimeType(MimeType mediaType)
           
 void addMimeType(String mediaType)
           
 SortedSet<? extends MimeType> getAcceptable()
           
 List<? extends MimeType> getAcceptable(String mediaType)
           
 List<? extends MimeType> getAcceptable(String[] mediaTypes)
           
 SortedSet<? extends MimeType> getCompatible(Collection<? extends MimeType> mediaTypes)
           
 SortedSet<? extends MimeType> getCompatible(String mediaType)
           
 SortedSet<? extends MimeType> getCompatible(String[] mediaTypes)
           
 boolean isAcceptable(String mediaType)
           
 boolean isAcceptable(String[] mediaTypes)
           
static boolean isCompatible(MimeType accept, MimeType media)
           
static MimeType parse(String mediaType)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Accepter

public Accepter()

Accepter

public Accepter(String accept)
         throws MimeTypeParseException
Throws:
MimeTypeParseException

Accepter

public Accepter(String... mediaTypes)
         throws MimeTypeParseException
Throws:
MimeTypeParseException

Accepter

public Accepter(Collection<MimeType> mediaTypes)
Method Detail

parse

public static MimeType parse(String mediaType)
                      throws MimeTypeParseException
Throws:
MimeTypeParseException

isCompatible

public static boolean isCompatible(MimeType accept,
                                   MimeType media)

addMimeType

public void addMimeType(String mediaType)
                 throws MimeTypeParseException
Throws:
MimeTypeParseException

addMimeType

public void addMimeType(MimeType mediaType)

toString

public String toString()
Overrides:
toString in class Object

isAcceptable

public boolean isAcceptable(String mediaType)
                     throws MimeTypeParseException
Throws:
MimeTypeParseException

isAcceptable

public boolean isAcceptable(String[] mediaTypes)
                     throws MimeTypeParseException
Throws:
MimeTypeParseException

getAcceptable

public SortedSet<? extends MimeType> getAcceptable()
                                            throws MimeTypeParseException
Throws:
MimeTypeParseException

getCompatible

public SortedSet<? extends MimeType> getCompatible(String mediaType)
                                            throws MimeTypeParseException
Throws:
MimeTypeParseException

getCompatible

public SortedSet<? extends MimeType> getCompatible(String[] mediaTypes)
                                            throws MimeTypeParseException
Throws:
MimeTypeParseException

getCompatible

public SortedSet<? extends MimeType> getCompatible(Collection<? extends MimeType> mediaTypes)
                                            throws MimeTypeParseException
Throws:
MimeTypeParseException

getAcceptable

public List<? extends MimeType> getAcceptable(String mediaType)
                                       throws MimeTypeParseException
Throws:
MimeTypeParseException

getAcceptable

public List<? extends MimeType> getAcceptable(String[] mediaTypes)
                                       throws MimeTypeParseException
Throws:
MimeTypeParseException


Copyright © 2004-2010 James Leigh Services Inc.. All Rights Reserved.