org.nhindirect.xd.transform.util.type
Enum MimeType

java.lang.Object
  extended by java.lang.Enum<MimeType>
      extended by org.nhindirect.xd.transform.util.type.MimeType
All Implemented Interfaces:
Serializable, Comparable<MimeType>

public enum MimeType
extends Enum<MimeType>

Enumeration of commonly used MIME types.

Author:
beau

Enum Constant Summary
APPLICATION_CCR
           
APPLICATION_PDF
           
APPLICATION_XML
           
MULTIPART
           
MULTIPART_MIXED
           
TEXT_CDA_XML
           
TEXT_HTML
           
TEXT_PLAIN
           
TEXT_XML
           
UNKNOWN
           
 
Method Summary
 String getSuffix()
          Return the suffix.
 String getType()
          Return the type.
static MimeType lookup(String type)
          Lookup a MimeType enumeration by type.
 boolean matches(String type)
          Determine if the input matches the current element by first comparing equalsIgnoreCase and then comparing startsWith.
 String toString()
           
static MimeType valueOf(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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TEXT_PLAIN

public static final MimeType TEXT_PLAIN

TEXT_XML

public static final MimeType TEXT_XML

TEXT_HTML

public static final MimeType TEXT_HTML

TEXT_CDA_XML

public static final MimeType TEXT_CDA_XML

APPLICATION_CCR

public static final MimeType APPLICATION_CCR

APPLICATION_XML

public static final MimeType APPLICATION_XML

APPLICATION_PDF

public static final MimeType APPLICATION_PDF

MULTIPART_MIXED

public static final MimeType MULTIPART_MIXED

MULTIPART

public static final MimeType MULTIPART

UNKNOWN

public static final MimeType UNKNOWN
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(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

matches

public boolean matches(String type)
Determine if the input matches the current element by first comparing equalsIgnoreCase and then comparing startsWith.

Parameters:
type - The MIME type to compare.
Returns:
true if the string is a reasonable match, false otherwise.

lookup

public static MimeType lookup(String type)
Lookup a MimeType enumeration by type.

Parameters:
type - The type to use for lookup.
Returns:
the matching MimeType or UNKNOWN if not found.

getType

public String getType()
Return the type.

Returns:
the type.

getSuffix

public String getSuffix()
Return the suffix.

Returns:
the suffix.

toString

public String toString()
Overrides:
toString in class Enum<MimeType>


Copyright © 2010-2011. All Rights Reserved.