com.silverpeas.converter
Enum DocumentFormat

java.lang.Object
  extended by java.lang.Enum<DocumentFormat>
      extended by com.silverpeas.converter.DocumentFormat
All Implemented Interfaces:
Serializable, Comparable<DocumentFormat>

public enum DocumentFormat
extends Enum<DocumentFormat>

Enumeration of the different formats of documents supported in Silverpeas.


Enum Constant Summary
doc
          The MS-Word 97/2000/XP format.
html
          The HTML format.
odt
          The OpenDocument format for text.
pdf
          The Portable Document Format aka PDF.
rtf
          The Microsoft's Rich Text Format aka RTF.
 
Method Summary
 String getMimeType()
          Gets the MIME type corrsponding to this document format.
static DocumentFormat inFormat(DocumentFormat format)
          A helper method to improve readability in method calls with a document format as argument.
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 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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

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.

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 name
NullPointerException - 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.


Copyright © 2016 Silverpeas. All Rights Reserved.