org.ow2.dragon.util
Enum ContentType

java.lang.Object
  extended by java.lang.Enum<ContentType>
      extended by org.ow2.dragon.util.ContentType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ContentType>

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

An enumeration of Dragon supported content types

Author:
ofabre - eBM Websourcing

Enum Constant Summary
DOC
           
HTML
           
PDF
           
XML
           
 
Method Summary
static ContentType fromString(java.lang.String type)
          Return the ContentType related to the given string or null if it isn't supported
static java.lang.String getRelatedSuffix(ContentType type)
          Return the commonly acceptable file suffix for a given ContentType
Example: if ContentType.XML then suffix = ".xml"
 java.lang.String toString()
           
static ContentType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ContentType[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DOC

public static final ContentType DOC

PDF

public static final ContentType PDF

HTML

public static final ContentType HTML

XML

public static final ContentType XML
Method Detail

values

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

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

valueOf

public static ContentType 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

toString

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

fromString

public static ContentType fromString(java.lang.String type)
Return the ContentType related to the given string or null if it isn't supported

Parameters:
type - the string representing a potential ContentType
Returns:
the ContentType enum related to the given String

getRelatedSuffix

public static java.lang.String getRelatedSuffix(ContentType type)
Return the commonly acceptable file suffix for a given ContentType
Example: if ContentType.XML then suffix = ".xml"

Parameters:
type - a ContentType
Returns:
the corresponding file suffix


Copyright © 2008-2009 eBMWebsourcing. All Rights Reserved.