Enum Document.Format
- All Implemented Interfaces:
Comparable<Document.Format>
- Enclosing class:
Document
The file formats
read and write understand.-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe binary format of Word 97 to 2003.Office Open XML, the format of Word 2007 and later.HTML.Markdown with GitHub tables.Codename One's own.cn1doc: a ZIP holdingdocument.xml.OpenDocument text, the format of LibreOffice Writer.PDF, laid out into pages asDocumentViewshows them.Rich Text Format.Plain UTF-8 text. -
Method Summary
Modifier and TypeMethodDescriptionThe usual file extension, without the dot.static Document.FormatforFileName(String fileName) The format a file name's extension names.static Document.FormatReturns the enum constant of this type with the specified name.static Document.Format[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
NATIVE
Codename One's own.cn1doc: a ZIP holdingdocument.xml. Keeps everything the model holds, page features included: sections, columns, headers and footers, floating pictures, tab stops, indents and table column widths. Files written by the Codename One word processor open too; whatever they hold beyond this model is skipped. -
TEXT
Plain UTF-8 text. Formatting and every page feature are lost; tables become tab separated lines. -
HTML
HTML. Reading accepts common markup, tables (withcolspan/rowspan) anddata:URI images; writing produces a complete page. A web page has no pages: sections, columns, headers and footers are dropped and a floating picture is written in the flow of the text. -
MARKDOWN
Markdown with GitHub tables. Like HTML it keeps no page features: sections, columns, headers, footers, text wrap, tab stops and column widths are dropped. -
DOCX
Office Open XML, the format of Word 2007 and later. Reads and writes styles, lists, tables with merged cells and column widths, pictures inline and floating with text wrap, fields, notes, comments, tracked changes, sections with columns, headers and footers, tab stops and indents; text boxes and charts are skipped. -
ODT
OpenDocument text, the format of LibreOffice Writer. Reads and writes styles, lists, tables with spans and column widths, pictures inline and floating with text wrap, notes, annotations, tracked changes, sections with columns (as master pages and text sections), headers and footers, tab stops and indents. -
RTF
Rich Text Format. Reads and writes character formatting, styles, lists, indents, tab stops, tables with merged cells, links, fields, notes, PNG and JPEG pictures, annotations and tracked changes; nested tables are written as tab separated lines. Page features are not written: sections, columns, headers and footers are dropped and floating pictures are written inline. -
DOC
The binary format of Word 97 to 2003. Read only: styles, lists, tables with merged cells, pictures, fields, notes, comments and tracked changes are read; writing throws, since files should be saved as DOCX. -
PDF
PDF, laid out into pages asDocumentViewshows them. Write only: reading throws.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
extension
The usual file extension, without the dot.
Returns
the extension
-
forFileName
The format a file name's extension names.
Parameters
fileName: a file name or path
Returns
the format, or null when the extension is not one of these
-