public static class H.Format extends Object implements Serializable
Specify the format of the requested content type
Modifier and Type | Class and Description |
---|---|
static class |
H.Format.Ordinal |
Modifier and Type | Field and Description |
---|---|
static H.Format |
AVI |
static H.Format |
BINARY |
static H.Format |
BMP |
static H.Format |
CSS
The “text/css” content format
|
static H.Format |
csv
Deprecated.
|
static H.Format |
CSV
The “text/csv” content format
|
static H.Format |
doc
Deprecated.
|
static H.Format |
DOC
The “application/vnd.ms-word” content format
|
static H.Format |
docx
Deprecated.
|
static H.Format |
DOCX
The “application/vnd.openxmlformats-officedocument.wordprocessingml.document” content format
|
static H.Format |
FLV |
static H.Format |
form_multipart_data
Deprecated.
|
static H.Format |
FORM_MULTIPART_DATA
The “multipart/form-data” content format
|
static H.Format |
form_url_encoded
Deprecated.
|
static H.Format |
FORM_URL_ENCODED
The “application/x-www-form-urlencoded” content format
|
static H.Format |
GIF |
static H.Format |
html
Deprecated.
|
static H.Format |
HTML
The “text/html” content format
|
static H.Format |
ICO |
static H.Format |
JAVASCRIPT
The “application/javascript” content format
|
static H.Format |
JPG |
static H.Format |
json
Deprecated.
|
static H.Format |
JSON
The “application/json” content format
|
static H.Format |
MOD |
static H.Format |
MOV |
static H.Format |
MP3 |
static H.Format |
MP4 |
static H.Format |
MPA |
static H.Format |
MPG |
static H.Format |
OGA |
static H.Format |
OGV |
static H.Format |
pdf
Deprecated.
|
static H.Format |
PDF
The “application/pdf” content format
|
static H.Format |
PNG |
static H.Format |
rtf
Deprecated.
|
static H.Format |
RTF
The “application/rtf” content format
|
static H.Format |
SVG |
static H.Format |
TIF |
static H.Format |
txt
Deprecated.
|
static H.Format |
TXT
The “text/plain” content format
|
static H.Format |
unknown
Deprecated.
|
static H.Format |
UNKNOWN
The “unknown” content format.
|
static H.Format |
WAV |
static H.Format |
WEBM |
static H.Format |
xls
Deprecated.
|
static H.Format |
XLS
The “application/vnd.ms-excel” content format
|
static H.Format |
xlsx
Deprecated.
|
static H.Format |
XLSX
The “application/vnd.openxmlformats-officedocument.spreadsheetml.sheet” content format
|
static H.Format |
xml
Deprecated.
|
static H.Format |
XML
The “text/xml” content format
|
static H.Format |
YAML
The “text/vnd.yaml” content format
|
Modifier and Type | Method and Description |
---|---|
String |
contentType()
Returns the content type string
|
boolean |
equals(Object obj) |
String |
errorMessage(String message)
Returns the error message
|
String |
getContentType() |
String |
getName() |
int |
hashCode() |
boolean |
isSameTypeWith(H.Format fmt)
Check if this format has the same content type with specified format.
|
boolean |
isSameTypeWith(org.osgl.util.MimeType type)
Check if this format has the same content type with the type of the
MimeType specified. |
boolean |
isSameTypeWithAny(H.Format... formats)
Check if this format has the same content type with the content type of any format in the specified list.
|
boolean |
isSameTypeWithAny(org.osgl.util.MimeType... types)
Check if this format has the same content type with the content type of any format in the specified list.
|
boolean |
isText() |
String |
name() |
static H.Format |
of(org.osgl.util.MimeType type) |
static H.Format |
of(String name) |
static H.Format |
of(String name,
String contentType) |
int |
ordinal() |
static List<H.Format> |
predefined() |
static H.Format |
resolve(H.Format def,
Iterable<String> accepts) |
static H.Format |
resolve(H.Format def,
String... accepts) |
static H.Format |
resolve(H.Format def,
String accept) |
static H.Format |
resolve(Iterable<String> accepts) |
static H.Format |
resolve(String... accepts) |
static H.Format |
resolve(String accept)
Resolve
Format instance out of an http “Accept” header. |
String |
toContentType()
Deprecated.
|
static String |
toContentType(String fmt) |
String |
toString() |
static H.Format |
valueOf(String name) |
static H.Format |
valueOf(String name,
String contentType) |
static H.Format[] |
values()
Deprecated.
|
public static final H.Format HTML
The “text/html” content format
@Deprecated public static final H.Format html
Deprecated, please use HTML
public static final H.Format XML
The “text/xml” content format
@Deprecated public static final H.Format xml
Deprecated, please use XML
public static final H.Format JSON
The “application/json” content format
@Deprecated public static final H.Format json
Deprecated. Please use JSON
public static final H.Format YAML
The “text/vnd.yaml” content format
public static final H.Format CSS
The “text/css” content format
public static final H.Format JAVASCRIPT
The “application/javascript” content format
public static final H.Format XLS
The “application/vnd.ms-excel” content format
public static final H.Format XLSX
The “application/vnd.openxmlformats-officedocument.spreadsheetml.sheet” content format
public static final H.Format DOC
The “application/vnd.ms-word” content format
public static final H.Format DOCX
The “application/vnd.openxmlformats-officedocument.wordprocessingml.document” content format
public static final H.Format CSV
The “text/csv” content format
@Deprecated public static final H.Format csv
Deprecated, please use CSV
public static final H.Format TXT
The “text/plain” content format
@Deprecated public static final H.Format txt
Deprecated, please use TXT
public static final H.Format PDF
The “application/pdf” content format
@Deprecated public static final H.Format pdf
Deprecated, please use PDF
public static final H.Format RTF
The “application/rtf” content format
@Deprecated public static final H.Format rtf
Deprecated, please use RTF
public static final H.Format GIF
public static final H.Format ICO
public static final H.Format JPG
public static final H.Format BMP
public static final H.Format PNG
public static final H.Format SVG
public static final H.Format TIF
public static final H.Format MOV
public static final H.Format MP4
public static final H.Format MPG
public static final H.Format AVI
public static final H.Format FLV
public static final H.Format OGV
public static final H.Format WEBM
public static final H.Format MP3
public static final H.Format MPA
public static final H.Format WAV
public static final H.Format MOD
public static final H.Format OGA
public static final H.Format FORM_URL_ENCODED
The “application/x-www-form-urlencoded” content format
@Deprecated public static final H.Format form_url_encoded
Deprecated, please use FORM_URL_ENCODED
public static final H.Format FORM_MULTIPART_DATA
The “multipart/form-data” content format
@Deprecated public static final H.Format form_multipart_data
Deprecated, please use FORM_MULTIPART_DATA
public static final H.Format BINARY
public static final H.Format UNKNOWN
The “unknown” content format. Use default content type: “text/html”
@Deprecated public static final H.Format unknown
Deprecated, please use UNKNOWN
public final String name()
public final int ordinal()
public String contentType()
Returns the content type string
public boolean isSameTypeWith(H.Format fmt)
Check if this format has the same content type with specified format.
fmt
- the format to be tested against this formattrue
if the fmt has the same content type with this format.public boolean isSameTypeWithAny(H.Format... formats)
Check if this format has the same content type with the content type of any format in the specified list.
formats
- an array of formats to test this format.true
if this format has same content type with any any of the format specified.public boolean isSameTypeWith(org.osgl.util.MimeType type)
Check if this format has the same content type with the type of the MimeType
specified.
type
- the mime type to be testedtrue
if the mime type has the same type with the content type of this format.public boolean isSameTypeWithAny(org.osgl.util.MimeType... types)
Check if this format has the same content type with the content type of any format in the specified list.
types
- an array of mime types to test this format.true
if this format has same content type with any any of the format specified.@Deprecated public final String toContentType()
Deprecated. Please use contentType()
public final String getName()
public final String getContentType()
public boolean isText()
public String errorMessage(String message)
Returns the error message
message
- the messagepublic static H.Format[] values()
Deprecated. please Use predefined()
public static H.Format resolve(String accept)
Resolve Format
instance out of an http “Accept” header.
accept
- the value of http “Accept” headerFormat
instancepublic static H.Format of(org.osgl.util.MimeType type)
Copyright © 2017–2020 OSGL (Open Source General Library). All rights reserved.