com.sun.jersey.core.header.reader
Class HttpHeaderReader

java.lang.Object
  extended by com.sun.jersey.core.header.reader.HttpHeaderReader

public abstract class HttpHeaderReader
extends Object

A pull-based reader of HTTP headers.

Author:
Paul.Sandoz@Sun.Com

Nested Class Summary
static class HttpHeaderReader.Event
           
static interface HttpHeaderReader.ListElementCreator<T>
           
 
Constructor Summary
HttpHeaderReader()
           
 
Method Summary
abstract  HttpHeaderReader.Event getEvent()
           
abstract  String getEventValue()
           
abstract  int getIndex()
           
abstract  String getRemainder()
           
abstract  boolean hasNext()
           
abstract  boolean hasNextSeparator(char separator, boolean skipWhiteSpace)
           
static HttpHeaderReader newInstance(String header)
           
static HttpHeaderReader newInstance(String header, boolean processComments)
           
abstract  HttpHeaderReader.Event next()
           
abstract  HttpHeaderReader.Event next(boolean skipWhiteSpace)
           
 String nextQuotedString()
           
abstract  String nextSeparatedString(char startSeparator, char endSeparator)
           
 char nextSeparator()
           
 void nextSeparator(char c)
           
 String nextToken()
           
 String nextTokenOrQuotedString()
           
static
<T> List<T>
readAcceptableList(Comparator<T> comparator, HttpHeaderReader.ListElementCreator<T> c, String header)
           
static
<T extends QualityFactor>
List<T>
readAcceptableList(HttpHeaderReader.ListElementCreator<T> c, String header)
           
static List<AcceptableLanguageTag> readAcceptLanguage(String header)
           
static List<AcceptableMediaType> readAcceptMediaType(String header)
           
static List<AcceptableMediaType> readAcceptMediaType(String header, List<QualitySourceMediaType> priorityMediaTypes)
           
static List<AcceptableToken> readAcceptToken(String header)
           
static javax.ws.rs.core.Cookie readCookie(String header)
           
static Map<String,javax.ws.rs.core.Cookie> readCookies(String header)
           
static Date readDate(String date)
           
static
<T> List<T>
readList(HttpHeaderReader.ListElementCreator<T> c, String header)
           
static
<T> List<T>
readList(List<T> l, HttpHeaderReader.ListElementCreator<T> c, String header)
           
static Set<MatchingEntityTag> readMatchingEntityTag(String header)
           
static List<javax.ws.rs.core.MediaType> readMediaTypes(List<javax.ws.rs.core.MediaType> l, String header)
           
static javax.ws.rs.core.NewCookie readNewCookie(String header)
           
static Map<String,String> readParameters(HttpHeaderReader reader)
           
static int readQualityFactor(String q)
           
static int readQualityFactorParameter(HttpHeaderReader reader)
           
static List<QualitySourceMediaType> readQualitySourceMediaType(String header)
           
static List<QualitySourceMediaType> readQualitySourceMediaType(String[] header)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpHeaderReader

public HttpHeaderReader()
Method Detail

hasNext

public abstract boolean hasNext()

hasNextSeparator

public abstract boolean hasNextSeparator(char separator,
                                         boolean skipWhiteSpace)

next

public abstract HttpHeaderReader.Event next()
                                     throws ParseException
Throws:
ParseException

next

public abstract HttpHeaderReader.Event next(boolean skipWhiteSpace)
                                     throws ParseException
Throws:
ParseException

nextSeparatedString

public abstract String nextSeparatedString(char startSeparator,
                                           char endSeparator)
                                    throws ParseException
Throws:
ParseException

getEvent

public abstract HttpHeaderReader.Event getEvent()

getEventValue

public abstract String getEventValue()

getRemainder

public abstract String getRemainder()

getIndex

public abstract int getIndex()

nextToken

public String nextToken()
                 throws ParseException
Throws:
ParseException

nextSeparator

public char nextSeparator()
                   throws ParseException
Throws:
ParseException

nextSeparator

public void nextSeparator(char c)
                   throws ParseException
Throws:
ParseException

nextQuotedString

public String nextQuotedString()
                        throws ParseException
Throws:
ParseException

nextTokenOrQuotedString

public String nextTokenOrQuotedString()
                               throws ParseException
Throws:
ParseException

newInstance

public static HttpHeaderReader newInstance(String header)

newInstance

public static HttpHeaderReader newInstance(String header,
                                           boolean processComments)

readDate

public static Date readDate(String date)
                     throws ParseException
Throws:
ParseException

readQualityFactor

public static int readQualityFactor(String q)
                             throws ParseException
Throws:
ParseException

readQualityFactorParameter

public static int readQualityFactorParameter(HttpHeaderReader reader)
                                      throws ParseException
Throws:
ParseException

readParameters

public static Map<String,String> readParameters(HttpHeaderReader reader)
                                         throws ParseException
Throws:
ParseException

readCookies

public static Map<String,javax.ws.rs.core.Cookie> readCookies(String header)

readCookie

public static javax.ws.rs.core.Cookie readCookie(String header)

readNewCookie

public static javax.ws.rs.core.NewCookie readNewCookie(String header)

readMatchingEntityTag

public static Set<MatchingEntityTag> readMatchingEntityTag(String header)
                                                    throws ParseException
Throws:
ParseException

readMediaTypes

public static List<javax.ws.rs.core.MediaType> readMediaTypes(List<javax.ws.rs.core.MediaType> l,
                                                              String header)
                                                       throws ParseException
Throws:
ParseException

readAcceptMediaType

public static List<AcceptableMediaType> readAcceptMediaType(String header)
                                                     throws ParseException
Throws:
ParseException

readQualitySourceMediaType

public static List<QualitySourceMediaType> readQualitySourceMediaType(String header)
                                                               throws ParseException
Throws:
ParseException

readQualitySourceMediaType

public static List<QualitySourceMediaType> readQualitySourceMediaType(String[] header)
                                                               throws ParseException
Throws:
ParseException

readAcceptMediaType

public static List<AcceptableMediaType> readAcceptMediaType(String header,
                                                            List<QualitySourceMediaType> priorityMediaTypes)
                                                     throws ParseException
Throws:
ParseException

readAcceptToken

public static List<AcceptableToken> readAcceptToken(String header)
                                             throws ParseException
Throws:
ParseException

readAcceptLanguage

public static List<AcceptableLanguageTag> readAcceptLanguage(String header)
                                                      throws ParseException
Throws:
ParseException

readAcceptableList

public static <T extends QualityFactor> List<T> readAcceptableList(HttpHeaderReader.ListElementCreator<T> c,
                                                                   String header)
                                                        throws ParseException
Throws:
ParseException

readAcceptableList

public static <T> List<T> readAcceptableList(Comparator<T> comparator,
                                             HttpHeaderReader.ListElementCreator<T> c,
                                             String header)
                                  throws ParseException
Throws:
ParseException

readList

public static <T> List<T> readList(HttpHeaderReader.ListElementCreator<T> c,
                                   String header)
                        throws ParseException
Throws:
ParseException

readList

public static <T> List<T> readList(List<T> l,
                                   HttpHeaderReader.ListElementCreator<T> c,
                                   String header)
                        throws ParseException
Throws:
ParseException


Copyright © 2011 Oracle Corporation. All Rights Reserved.