Class AcceptMediaType

java.lang.Object
javax.ws.rs.core.MediaType
org.exoplatform.services.rest.impl.header.AcceptMediaType
All Implemented Interfaces:
QualityValue

public class AcceptMediaType extends javax.ws.rs.core.MediaType implements QualityValue
Version:
$Id: $
Author:
Andrey Parfonov
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final AcceptMediaType
    Default accepted media type, it minds any content type is acceptable.

    Fields inherited from class javax.ws.rs.core.MediaType

    APPLICATION_ATOM_XML, APPLICATION_ATOM_XML_TYPE, APPLICATION_FORM_URLENCODED, APPLICATION_FORM_URLENCODED_TYPE, APPLICATION_JSON, APPLICATION_JSON_TYPE, APPLICATION_OCTET_STREAM, APPLICATION_OCTET_STREAM_TYPE, APPLICATION_SVG_XML, APPLICATION_SVG_XML_TYPE, APPLICATION_XHTML_XML, APPLICATION_XHTML_XML_TYPE, APPLICATION_XML, APPLICATION_XML_TYPE, MEDIA_TYPE_WILDCARD, MULTIPART_FORM_DATA, MULTIPART_FORM_DATA_TYPE, TEXT_HTML, TEXT_HTML_TYPE, TEXT_PLAIN, TEXT_PLAIN_TYPE, TEXT_XML, TEXT_XML_TYPE, WILDCARD, WILDCARD_TYPE

    Fields inherited from interface org.exoplatform.services.rest.header.QualityValue

    DEFAULT_QUALITY_VALUE, QVALUE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of MediaType, both type and sub-type are wildcards and set quality value to default quality value.
    AcceptMediaType(String type, String subtype)
    Constructs AcceptedMediaType with default quality value.
    AcceptMediaType(String type, String subtype, Map<String,String> parameters)
    Constructs AcceptedMediaType with supplied quality value.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    valueOf(String header)
    Creates a new instance of AcceptedMediaType by parsing the supplied string.

    Methods inherited from class javax.ws.rs.core.MediaType

    equals, getParameters, getSubtype, getType, hashCode, isCompatible, isWildcardSubtype, isWildcardType, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT

      public static final AcceptMediaType DEFAULT
      Default accepted media type, it minds any content type is acceptable.
  • Constructor Details

    • AcceptMediaType

      public AcceptMediaType()
      Creates a new instance of MediaType, both type and sub-type are wildcards and set quality value to default quality value.
    • AcceptMediaType

      public AcceptMediaType(String type, String subtype, Map<String,String> parameters)
      Constructs AcceptedMediaType with supplied quality value. If map parameters is null or does not contains value with key 'q' then default quality value will be used.
      Parameters:
      type - media type
      subtype - media sub-type
      parameters - addition header parameters
    • AcceptMediaType

      public AcceptMediaType(String type, String subtype)
      Constructs AcceptedMediaType with default quality value.
      Parameters:
      type - media type
      subtype - media sub-type
  • Method Details

    • valueOf

      public static AcceptMediaType valueOf(String header)
      Creates a new instance of AcceptedMediaType by parsing the supplied string.
      Parameters:
      header - accepted media type string
      Returns:
      AcceptedMediaType
    • getQvalue

      public float getQvalue()
      Specified by:
      getQvalue in interface QualityValue
      Returns:
      value of quality parameter