org.jopendocument.dom
Enum ContentTypeVersioned

java.lang.Object
  extended by java.lang.Enum<ContentTypeVersioned>
      extended by org.jopendocument.dom.ContentTypeVersioned
All Implemented Interfaces:
Serializable, Comparable<ContentTypeVersioned>

public enum ContentTypeVersioned
extends Enum<ContentTypeVersioned>

A ContentType of a certain version.

Author:
Sylvain

Enum Constant Summary
GRAPHICS
           
GRAPHICS_TEMPLATE
           
GRAPHICS_V1
           
PRESENTATION
           
PRESENTATION_TEMPLATE
           
PRESENTATION_V1
           
SPREADSHEET
           
SPREADSHEET_TEMPLATE
           
SPREADSHEET_V1
           
TEXT
           
TEXT_TEMPLATE
           
TEXT_V1
           
 
Method Summary
 org.jdom.Element createContent(XMLFormatVersion version)
          Create a new minimal document using ODPackage.RootElement.CONTENT.
 org.jdom.Element createContent(XMLFormatVersion version, boolean singleXML)
          Create a new minimal document.
 ODPackage createPackage(XMLFormatVersion version)
          Creates an empty package.
 org.jdom.Document createStyles(XMLFormatVersion version)
          Create a new minimal document using ODPackage.RootElement.STYLES.
static ContentTypeVersioned fromMime(byte[] mime)
           
static ContentTypeVersioned fromMime(String mime)
           
 org.jdom.Element getBody(org.jdom.Document doc)
           
 String getBodyPath()
          Returns the xpath to the body (from below the root element).
 String getExtension()
           
 String getFlatExtension()
           
 String getMimeType()
           
 ContentTypeVersioned getNonTemplate()
           
 String getShortName()
           
 ContentTypeVersioned getTemplate()
           
 ContentType getType()
           
 XMLVersion getVersion()
           
 boolean isTemplate()
           
 void setType(org.jdom.Document doc)
           
static ContentTypeVersioned valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ContentTypeVersioned[] 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

TEXT_V1

public static final ContentTypeVersioned TEXT_V1

GRAPHICS_V1

public static final ContentTypeVersioned GRAPHICS_V1

PRESENTATION_V1

public static final ContentTypeVersioned PRESENTATION_V1

SPREADSHEET_V1

public static final ContentTypeVersioned SPREADSHEET_V1

TEXT

public static final ContentTypeVersioned TEXT

TEXT_TEMPLATE

public static final ContentTypeVersioned TEXT_TEMPLATE

GRAPHICS

public static final ContentTypeVersioned GRAPHICS

GRAPHICS_TEMPLATE

public static final ContentTypeVersioned GRAPHICS_TEMPLATE

PRESENTATION

public static final ContentTypeVersioned PRESENTATION

PRESENTATION_TEMPLATE

public static final ContentTypeVersioned PRESENTATION_TEMPLATE

SPREADSHEET

public static final ContentTypeVersioned SPREADSHEET

SPREADSHEET_TEMPLATE

public static final ContentTypeVersioned SPREADSHEET_TEMPLATE
Method Detail

values

public static ContentTypeVersioned[] 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 (ContentTypeVersioned c : ContentTypeVersioned.values())
    System.out.println(c);

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

valueOf

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

getVersion

public final XMLVersion getVersion()

getShortName

public final String getShortName()

getBodyPath

public final String getBodyPath()
Returns the xpath to the body (from below the root element).

Returns:
the xpath to the body, e.g. "./office:body".

getBody

public final org.jdom.Element getBody(org.jdom.Document doc)

getMimeType

public final String getMimeType()

getType

public final ContentType getType()

getExtension

public final String getExtension()

getFlatExtension

public final String getFlatExtension()

isTemplate

public final boolean isTemplate()

getTemplate

public final ContentTypeVersioned getTemplate()

getNonTemplate

public final ContentTypeVersioned getNonTemplate()

createContent

public final org.jdom.Element createContent(XMLFormatVersion version)
Create a new minimal document using ODPackage.RootElement.CONTENT.

Parameters:
version - the version.
Returns:
the body of the created document.
See Also:
createContent(XMLFormatVersion, boolean)

createContent

public org.jdom.Element createContent(XMLFormatVersion version,
                                      boolean singleXML)
Create a new minimal document.

Parameters:
version - the version.
singleXML - true for ODPackage.RootElement.SINGLE_CONTENT, false for ODPackage.RootElement.CONTENT.
Returns:
the body of the created document.
See Also:
createPackage(XMLFormatVersion)

setType

public void setType(org.jdom.Document doc)

createStyles

public org.jdom.Document createStyles(XMLFormatVersion version)
Create a new minimal document using ODPackage.RootElement.STYLES.

Parameters:
version - the version.
Returns:
the created document.

createPackage

public ODPackage createPackage(XMLFormatVersion version)
Creates an empty package.

Parameters:
version - the version of the package.
Returns:
a new package with minimal ODPackage.RootElement.CONTENT and ODPackage.RootElement.STYLES

fromMime

public static ContentTypeVersioned fromMime(String mime)

fromMime

public static ContentTypeVersioned fromMime(byte[] mime)


Copyright © 2010 jOpenDocument All Rights Reserved.