Enum DocumentFormat
- java.lang.Object
-
- java.lang.Enum<DocumentFormat>
-
- org.silverpeas.core.contribution.converter.DocumentFormat
-
- All Implemented Interfaces:
Serializable
,Comparable<DocumentFormat>
public enum DocumentFormat extends Enum<DocumentFormat>
Enumeration of the different formats of documents supported in Silverpeas.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getMimeType()
Gets the MIME type corrsponding to this document format.static DocumentFormat
inFormat(String format)
A helper method to both improve the readability in method calls and to encode a string representation of a document format into the corresponding instance.static DocumentFormat
inFormat(DocumentFormat format)
A helper method to improve readability in method calls with a document format as argument.static DocumentFormat
valueOf(String name)
Returns the enum constant of this type with the specified name.static DocumentFormat[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
pdf
public static final DocumentFormat pdf
The Portable Document Format aka PDF. ISO 32000-1:2008 standard format.
-
doc
public static final DocumentFormat doc
The MS-Word 97/2000/XP format.
-
rtf
public static final DocumentFormat rtf
The Microsoft's Rich Text Format aka RTF.
-
odt
public static final DocumentFormat odt
The OpenDocument format for text. ISO 26300:2006 standard format.
-
html
public static final DocumentFormat html
The HTML format.
-
sql
public static final DocumentFormat sql
The SQL format.
-
-
Method Detail
-
values
public static DocumentFormat[] 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 (DocumentFormat c : DocumentFormat.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DocumentFormat 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 nameNullPointerException
- if the argument is null
-
inFormat
public static DocumentFormat inFormat(DocumentFormat format)
A helper method to improve readability in method calls with a document format as argument.- Parameters:
format
- a document format.- Returns:
- the document format passed as argument.
-
inFormat
public static DocumentFormat inFormat(String format)
A helper method to both improve the readability in method calls and to encode a string representation of a document format into the corresponding instance.- Parameters:
format
- the format of the document.- Returns:
- an instance of DocumentFormat corresponding to the specified format.
-
getMimeType
public String getMimeType()
Gets the MIME type corrsponding to this document format.- Returns:
- the MIME type of this document format.
-
-