Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.any23.servlet.conneg
Class MediaRangeSpec

    java.lang.Object
      org.apache.any23.servlet.conneg.MediaRangeSpec

    public class MediaRangeSpec

extends Object

This class implements the HTTP header media-range specification.
See RFC 2616 section 14.1.

Method Summary
`MediaRangeSpec` | `getBestMatch(List<MediaRangeSpec> mediaRanges)`
`String` | `getMediaType()`
`String` | `getParameter(String parameterName)`
`List<String>` | `getParameterNames()`
`int` | `getPrecedence(MediaRangeSpec range)`
`double` | `getQuality()`
`String` | `getSubtype()`
`String` | `getType()`
`boolean` | `isWildcardSubtype()`
`boolean` | `isWildcardType()`
`static List<MediaRangeSpec>` | `parseAccept(String s)` Parses an HTTP Accept header into a List of MediaRangeSpecs
`static MediaRangeSpec` | `parseRange(String mediaRange)` Parses a media range from a string such as `text/*;charset=utf-8;q=0.9`.
`static MediaRangeSpec` | `parseType(String mediaType)` Parses a media type from a string such as `text/html;charset=utf-8;q=0.9`.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### parseType

    public static MediaRangeSpec parseType(String mediaType)

  Parses a media type from a string such as `text/html;charset=utf-8;q=0.9`.

### parseRange

    public static MediaRangeSpec parseRange(String mediaRange)

  Parses a media range from a string such as `text/*;charset=utf-8;q=0.9`. Unlike simple media types, media ranges may include wildcards.

### parseAccept

    public static List<MediaRangeSpec> parseAccept(String s)

  Parses an HTTP Accept header into a List of MediaRangeSpecs

  Returns:
    A List of MediaRangeSpecs

### getType

    public String getType()

### getSubtype

    public String getSubtype()

### getMediaType

    public String getMediaType()

### getParameterNames

    public List<String> getParameterNames()

### getParameter

    public String getParameter(String parameterName)

### isWildcardType

    public boolean isWildcardType()

### isWildcardSubtype

    public boolean isWildcardSubtype()

### getQuality

    public double getQuality()

### getPrecedence

    public int getPrecedence(MediaRangeSpec range)

### getBestMatch

    public MediaRangeSpec getBestMatch(List<MediaRangeSpec> mediaRanges)

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.