Class AcceptMediaType
java.lang.Object
javax.ws.rs.core.MediaType
org.exoplatform.services.rest.impl.header.AcceptMediaType
- All Implemented Interfaces:
QualityValue
- Version:
- $Id: $
- Author:
- Andrey Parfonov
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AcceptMediaTypeDefault 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_TYPEFields inherited from interface org.exoplatform.services.rest.header.QualityValue
DEFAULT_QUALITY_VALUE, QVALUE -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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.Constructs AcceptedMediaType with supplied quality value. -
Method Summary
Modifier and TypeMethodDescriptionfloatstatic AcceptMediaTypeCreates 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
-
Field Details
-
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
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 typesubtype- media sub-typeparameters- addition header parameters
-
AcceptMediaType
Constructs AcceptedMediaType with default quality value.- Parameters:
type- media typesubtype- media sub-type
-
-
Method Details
-
valueOf
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:
getQvaluein interfaceQualityValue- Returns:
- value of quality parameter
-