|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||
java.lang.Objectjava.lang.Enum<MediaType>
org.baswell.routes.MediaType
public enum MediaType
Media types that Routes is aware of. A media type has one or more mime types and one more file extensions.
Route.respondsToMediaRequests(),
RequestedMediaType.mediaType| Enum Constant Summary | |
|---|---|
ATOM
|
|
CSV
|
|
EXCEL
|
|
HTML
|
|
ICS
|
|
JAVASCRIPT
|
|
JSON
|
|
PDF
|
|
RSS
|
|
TEXT
|
|
WORD
|
|
XML
|
|
| Field Summary | |
|---|---|
java.lang.String |
extension
The default file extension. |
java.util.List<java.lang.String> |
extensions
All file extensions. |
java.lang.String |
mimeType
The default mime type. |
java.util.List<java.lang.String> |
mimeTypes
All mime types. |
| Method Summary | |
|---|---|
static MediaType |
findFromExtension(java.lang.String extension)
|
static MediaType |
findFromMediaTypeParameter(java.lang.String mediaTypeParameter)
|
static MediaType |
findFromMimeType(java.lang.String mimeTypes)
|
static MediaType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static MediaType[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final MediaType ATOM
public static final MediaType CSV
public static final MediaType EXCEL
public static final MediaType HTML
public static final MediaType ICS
public static final MediaType JAVASCRIPT
public static final MediaType JSON
public static final MediaType PDF
public static final MediaType RSS
public static final MediaType TEXT
public static final MediaType WORD
public static final MediaType XML
| Field Detail |
|---|
public final java.lang.String mimeType
public final java.util.List<java.lang.String> mimeTypes
public final java.lang.String extension
public final java.util.List<java.lang.String> extensions
| Method Detail |
|---|
public static MediaType[] values()
for (MediaType c : MediaType.values()) System.out.println(c);
public static MediaType valueOf(java.lang.String name)
name - the name of the enum constant to be returned.
java.lang.IllegalArgumentException - if this enum type has no constant
with the specified name
java.lang.NullPointerException - if the argument is nullpublic static MediaType findFromMimeType(java.lang.String mimeTypes)
mimeTypes - A comma delimitted list of mime types
MediaType that has a matching mime type or null.public static MediaType findFromExtension(java.lang.String extension)
extension - The file extension
MediaType that has a matching file extension or null.public static MediaType findFromMediaTypeParameter(java.lang.String mediaTypeParameter)
mediaTypeParameter - The media type parameter
MediaType that has the same name as the format parameter (ex. mediaType=json) or null.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||