com.eclipsesource.restfuse
Enum MediaType

java.lang.Object
  extended by java.lang.Enum<MediaType>
      extended by com.eclipsesource.restfuse.MediaType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<MediaType>

public enum MediaType
extends java.lang.Enum<MediaType>

The MediaType enumeration contains values that can be used within a request as the request's content type.

See Also:
Request, Response

Enum Constant Summary
APPLICATION_ATOM_XML
           
APPLICATION_FORM_URLENCODED
           
APPLICATION_JSON
           
APPLICATION_OCTET_STREAM
           
APPLICATION_SVG_XML
           
APPLICATION_XHTML_XML
           
APPLICATION_XML
           
MULTIPART_FORM_DATA
           
TEXT_HTML
           
TEXT_PLAIN
           
TEXT_XML
           
WILDCARD
           
 
Method Summary
static MediaType fromString(java.lang.String type)
          The fromString() method tries to convert a mime-type to the equivalent MediaType.
 java.lang.String getMimeType()
           
 java.lang.String toString()
           
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
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

APPLICATION_ATOM_XML

public static final MediaType APPLICATION_ATOM_XML

APPLICATION_FORM_URLENCODED

public static final MediaType APPLICATION_FORM_URLENCODED

APPLICATION_JSON

public static final MediaType APPLICATION_JSON

APPLICATION_OCTET_STREAM

public static final MediaType APPLICATION_OCTET_STREAM

APPLICATION_SVG_XML

public static final MediaType APPLICATION_SVG_XML

APPLICATION_XHTML_XML

public static final MediaType APPLICATION_XHTML_XML

APPLICATION_XML

public static final MediaType APPLICATION_XML

MULTIPART_FORM_DATA

public static final MediaType MULTIPART_FORM_DATA

TEXT_HTML

public static final MediaType TEXT_HTML

TEXT_PLAIN

public static final MediaType TEXT_PLAIN

TEXT_XML

public static final MediaType TEXT_XML

WILDCARD

public static final MediaType WILDCARD
Method Detail

fromString

public static MediaType fromString(java.lang.String type)

The fromString() method tries to convert a mime-type to the equivalent MediaType.


getMimeType

public java.lang.String getMimeType()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<MediaType>

valueOf

public static MediaType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

values

public static MediaType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MediaType c : MediaType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared