Package org.w3c.epubcheck.constants
Enum MIMEType
- java.lang.Object
-
- java.lang.Enum<MIMEType>
-
- org.w3c.epubcheck.constants.MIMEType
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CSSDTBOOKEPUBHTMLIMAGE_GIFIMAGE_JPEGIMAGE_PNGOEBPSOTHERPACKAGE_DOCSEARCH_KEY_MAPSMILSVGXHTML
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringdefinitionprivate static java.util.Map<java.lang.String,MIMEType>ENUM_MAP
-
Constructor Summary
Constructors Modifier Constructor Description privateMIMEType(java.lang.String definition)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MIMETypeget(java.lang.String name)booleanis(java.lang.String string)static java.lang.StringremoveParams(java.lang.String typeString)Removes the (optional) parameters from a valid MIME type string, as defined in the MIME Sniffing standard.java.lang.StringtoString()static MIMETypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static MIMEType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CSS
public static final MIMEType CSS
-
DTBOOK
public static final MIMEType DTBOOK
-
EPUB
public static final MIMEType EPUB
-
HTML
public static final MIMEType HTML
-
IMAGE_JPEG
public static final MIMEType IMAGE_JPEG
-
IMAGE_GIF
public static final MIMEType IMAGE_GIF
-
IMAGE_PNG
public static final MIMEType IMAGE_PNG
-
OEBPS
public static final MIMEType OEBPS
-
PACKAGE_DOC
public static final MIMEType PACKAGE_DOC
-
SEARCH_KEY_MAP
public static final MIMEType SEARCH_KEY_MAP
-
SMIL
public static final MIMEType SMIL
-
SVG
public static final MIMEType SVG
-
XHTML
public static final MIMEType XHTML
-
OTHER
public static final MIMEType OTHER
-
-
Field Detail
-
ENUM_MAP
private static final java.util.Map<java.lang.String,MIMEType> ENUM_MAP
-
definition
private final java.lang.String definition
-
-
Method Detail
-
values
public static MIMEType[] 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 (MIMEType c : MIMEType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MIMEType 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 namejava.lang.NullPointerException- if the argument is null
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<MIMEType>
-
is
public boolean is(java.lang.String string)
-
get
public static MIMEType get(java.lang.String name)
-
removeParams
public static java.lang.String removeParams(java.lang.String typeString)
Removes the (optional) parameters from a valid MIME type string, as defined in the MIME Sniffing standard. In other words, this returns the essence ("type/subtype") of the MIME type described in the given string.For instance, calling this method on MIME type string
"audio/ogg; codecs=speex"will return the string"audio/ogg".Note: no validation is performed on the MIME type string itself; it simply returns the substring before the first "
;" character.- Parameters:
typeString- a MIME type string- Returns:
- a MIME type string with any parameter removed
-
-