|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.odftoolkit.odfdom.pkg.OdfPackageDocument
org.odftoolkit.odfdom.dom.OdfSchemaDocument
org.odftoolkit.simple.Document
org.odftoolkit.simple.SpreadsheetDocument
public class SpreadsheetDocument
This class represents an empty ODF spreadsheet document.
| Nested Class Summary | |
|---|---|
static class |
SpreadsheetDocument.OdfMediaType
This enum contains all possible media types of SpreadsheetDocument documents. |
| Nested classes/interfaces inherited from class org.odftoolkit.simple.Document |
|---|
Document.ScriptType |
| 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 |
SpreadsheetDocument(OdfPackage pkg,
String internalPath,
SpreadsheetDocument.OdfMediaType odfMediaType)
To avoid data duplication a new document is only created, if not already opened. |
| Method Summary | |
|---|---|
void |
changeMode(SpreadsheetDocument.OdfMediaType mediaType)
Changes the document to the given mediatype. |
OfficeSpreadsheetElement |
getContentRoot()
Get the content root of a spreadsheet document. |
static SpreadsheetDocument |
loadDocument(File file)
Creates an SpreadsheetDocument from the OpenDocument provided by a File. |
static SpreadsheetDocument |
loadDocument(InputStream inputStream)
Creates an SpreadsheetDocument from the OpenDocument provided by a resource Stream. |
static SpreadsheetDocument |
loadDocument(String documentPath)
Loads an SpreadsheetDocument from the provided path. |
static SpreadsheetDocument |
newSpreadsheetDocument()
Creates an empty spreadsheet document. |
static SpreadsheetDocument |
newSpreadsheetTemplateDocument()
Creates an empty spreadsheet template. |
| Methods inherited from class org.odftoolkit.simple.Document |
|---|
close, getContentRoot, getEmbeddedDocument, getEmbeddedDocuments, getEmbeddedDocuments, getLocale, getOdfMediaType, getOfficeMetadata, getScriptType, getSectionByName, getSectionIterator, getTableBuilder, getTableByName, getTableList, insertDocument, loadDocument, loadDocument, loadTemplate, newImage, removeElementLinkedResource, save, save, setLocale, setLocale, setOdfMediaType, toString |
| Methods inherited from class org.odftoolkit.odfdom.dom.OdfSchemaDocument |
|---|
getBaseURI, getContentDom, getContentStream, getDocumentStyles, getFileDom, getMetaDom, getMetaStream, getOfficeMasterStyles, getOrCreateDocumentStyles, getSettingsDom, getSettingsStream, getStylesDom, getStylesStream, getXMLFilePath |
| Methods inherited from class org.odftoolkit.odfdom.pkg.OdfPackageDocument |
|---|
flushDoms, getDocumentPath, getFileDom, getMediaTypeString, getPackage, isExternalReference, isRootDocument, loadSubDocument, normalizeDocumentPath, removeDocument, save, setMediaTypeString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected SpreadsheetDocument(OdfPackage pkg,
String internalPath,
SpreadsheetDocument.OdfMediaType odfMediaType)
| Method Detail |
|---|
public static SpreadsheetDocument newSpreadsheetDocument()
throws Exception
Exception - - if the document could not be created
public static SpreadsheetDocument newSpreadsheetTemplateDocument()
throws Exception
Exception - - if the template could not be created
public static SpreadsheetDocument loadDocument(InputStream inputStream)
throws Exception
Since an InputStream does not provide the arbitrary (non sequentiell) read access needed by SpreadsheetDocument, 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.
inputStream - - the InputStream of the ODF spreadsheet document.
Exception - - if the document could not be created.
public static SpreadsheetDocument loadDocument(String documentPath)
throws Exception
SpreadsheetDocument relies on the file being available for read access over the whole lifecycle of SpreadsheetDocument.
If the resource stream is not a ODF spreadsheet document, ClassCastException might be thrown.
documentPath - - the path from where the document can be loaded
Exception - - if the document could not be created.
public static SpreadsheetDocument loadDocument(File file)
throws Exception
SpreadsheetDocument relies on the file being available for read access over the whole lifecycle of SpreadsheetDocument.
If the resource stream is not a ODF spreadsheet document, ClassCastException might be thrown.
file - - a file representing the ODF spreadsheet document.
Exception - - if the document could not be created.
public OfficeSpreadsheetElement getContentRoot()
throws Exception
getContentRoot in class DocumentException - if the file DOM could not be created.public void changeMode(SpreadsheetDocument.OdfMediaType mediaType)
mediaType - the related ODF mimetype
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||