org.odftoolkit.odfdom.doc
Class OdfSpreadsheetDocument

java.lang.Object
  extended by org.odftoolkit.odfdom.pkg.OdfPackageDocument
      extended by org.odftoolkit.odfdom.dom.OdfSchemaDocument
          extended by org.odftoolkit.odfdom.doc.OdfDocument
              extended by org.odftoolkit.odfdom.doc.OdfSpreadsheetDocument
All Implemented Interfaces:
Closeable

Deprecated. As of release 0.8.8, replaced by org.odftoolkit.simple.SpreadsheetDocument in Simple API.

public class OdfSpreadsheetDocument
extends OdfDocument

This class represents an empty ODF spreadsheet document.


Nested Class Summary
static class OdfSpreadsheetDocument.OdfMediaType
          Deprecated. This enum contains all possible media types of OdfSpreadsheetDocument documents.
 
Nested classes/interfaces inherited from class org.odftoolkit.odfdom.doc.OdfDocument
OdfDocument.UnicodeGroup
 
Nested classes/interfaces inherited from class org.odftoolkit.odfdom.dom.OdfSchemaDocument
OdfSchemaDocument.OdfXMLFile
 
Nested classes/interfaces inherited from class org.odftoolkit.odfdom.pkg.OdfPackageDocument
OdfPackageDocument.Resource
 
Field Summary
 
Fields inherited from class org.odftoolkit.odfdom.dom.OdfSchemaDocument
mContentDom, mDocumentStyles, mMetaDom, mSettingsDom, mStylesDom
 
Fields inherited from class org.odftoolkit.odfdom.pkg.OdfPackageDocument
mDocumentMediaType, mDocumentPathInPackage, mPackage, ROOT_DOCUMENT_PATH
 
Constructor Summary
protected OdfSpreadsheetDocument(OdfPackage pkg, String internalPath, OdfSpreadsheetDocument.OdfMediaType odfMediaType)
          Deprecated. To avoid data duplication a new document is only created, if not already opened.
 
Method Summary
 void changeMode(OdfSpreadsheetDocument.OdfMediaType mediaType)
          Deprecated. Changes the document to the given mediatype.
 OfficeSpreadsheetElement getContentRoot()
          Deprecated. Get the content root of a spreadsheet document.
static OdfSpreadsheetDocument loadDocument(File file)
          Deprecated. Creates an OdfSpreadsheetDocument from the OpenDocument provided by a File.
static OdfSpreadsheetDocument loadDocument(InputStream inputStream)
          Deprecated. Creates an OdfSpreadsheetDocument from the OpenDocument provided by a resource Stream.
static OdfSpreadsheetDocument loadDocument(String documentPath)
          Deprecated. Loads an OdfSpreadsheetDocument from the provided path.
static OdfSpreadsheetDocument newSpreadsheetDocument()
          Deprecated. Creates an empty spreadsheet document.
static OdfSpreadsheetDocument newSpreadsheetTemplateDocument()
          Deprecated. Creates an empty spreadsheet template.
 
Methods inherited from class org.odftoolkit.odfdom.doc.OdfDocument
close, getLocale, getOdfMediaType, getOfficeMetadata, getTableByName, getTableList, getUnicodeGroup, loadDocument, loadDocument, loadSubDocument, loadSubDocuments, loadSubDocuments, loadTemplate, newImage, save, save, setLocale, setOdfMediaType, toString
 
Methods inherited from class org.odftoolkit.odfdom.dom.OdfSchemaDocument
getBaseURI, getBookmarkRDFMetadata, getContentDom, getContentStream, getDocumentStyles, getFileDom, getInContentMetadata, getInContentMetadataFromCache, getManifestRDFMetadata, getMasterPages, getMetaDom, getMetaStream, getOfficeMasterStyles, getOrCreateDocumentStyles, getRDFMetadata, getSettingsDom, getSettingsStream, getStylesDom, getStylesStream, getTables, getXMLFilePath
 
Methods inherited from class org.odftoolkit.odfdom.pkg.OdfPackageDocument
flushDoms, getDocumentPath, getFileDom, getMediaTypeString, getPackage, getXMLFileMetadata, insertDocument, isExternalReference, isRootDocument, normalizeDocumentPath, removeDocument, save, setMediaTypeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OdfSpreadsheetDocument

protected OdfSpreadsheetDocument(OdfPackage pkg,
                                 String internalPath,
                                 OdfSpreadsheetDocument.OdfMediaType odfMediaType)
                          throws SAXException
Deprecated. 
To avoid data duplication a new document is only created, if not already opened. A document is cached by this constructor using the internalpath as key.

Throws:
SAXException
Method Detail

newSpreadsheetDocument

public static OdfSpreadsheetDocument newSpreadsheetDocument()
                                                     throws Exception
Deprecated. 
Creates an empty spreadsheet document.

Returns:
ODF spreadsheet document based on a default template*
Throws:
Exception - - if the document could not be created

newSpreadsheetTemplateDocument

public static OdfSpreadsheetDocument newSpreadsheetTemplateDocument()
                                                             throws Exception
Deprecated. 
Creates an empty spreadsheet template.

Returns:
ODF spreadsheet template based on a default
Throws:
Exception - - if the template could not be created

loadDocument

public static OdfSpreadsheetDocument loadDocument(InputStream inputStream)
                                           throws Exception
Deprecated. 
Creates an OdfSpreadsheetDocument from the OpenDocument provided by a resource Stream.

Since an InputStream does not provide the arbitrary (non sequentiell) read access needed by OdfSpreadsheetDocument, the InputStream is cached. This usually takes more time compared to the other createInternalDocument methods. An advantage of caching is that there are no problems overwriting an input file.

If the resource stream is not a ODF spreadsheet document, ClassCastException might be thrown.

Parameters:
inputStream - - the InputStream of the ODF spreadsheet document.
Returns:
the spreadsheet document created from the given InputStream
Throws:
Exception - - if the document could not be created.

loadDocument

public static OdfSpreadsheetDocument loadDocument(String documentPath)
                                           throws Exception
Deprecated. 
Loads an OdfSpreadsheetDocument from the provided path.

OdfSpreadsheetDocument relies on the file being available for read access over the whole lifecycle of OdfSpreadsheetDocument.

If the resource stream is not a ODF spreadsheet document, ClassCastException might be thrown.

Parameters:
documentPath - - the path from where the document can be loaded
Returns:
the spreadsheet document from the given path or NULL if the media type is not supported by ODFDOM.
Throws:
Exception - - if the document could not be created.

loadDocument

public static OdfSpreadsheetDocument loadDocument(File file)
                                           throws Exception
Deprecated. 
Creates an OdfSpreadsheetDocument from the OpenDocument provided by a File.

OdfSpreadsheetDocument relies on the file being available for read access over the whole lifecycle of OdfSpreadsheetDocument.

If the resource stream is not a ODF spreadsheet document, ClassCastException might be thrown.

Parameters:
file - - a file representing the ODF spreadsheet document.
Returns:
the spreadsheet document created from the given File
Throws:
Exception - - if the document could not be created.

getContentRoot

public OfficeSpreadsheetElement getContentRoot()
                                        throws Exception
Deprecated. 
Get the content root of a spreadsheet document.

Overrides:
getContentRoot in class OdfDocument
Returns:
content root, representing the office:spreadsheet tag
Throws:
Exception - if the file DOM could not be created.

changeMode

public void changeMode(OdfSpreadsheetDocument.OdfMediaType mediaType)
Deprecated. 
Changes the document to the given mediatype. This method can only be used to convert a document to a related mediatype, e.g. template.

Parameters:
mediaType - the related ODF mimetype


Copyright © 2008-2017 The Apache Software Foundation. All Rights Reserved.