Package com.independentsoft.office.odf
Class Document
java.lang.Object
com.independentsoft.office.odf.Document
- Direct Known Subclasses:
Chart,Spreadsheet,TextDocument
Represents a document in OpenDocument format.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommonStylesprotected FileTableprotected FileTableprotected booleanprotected Manifestprotected MetaDataprotected Stringprotected ZipOutputStreamprotected Settingsprotected Charset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidaddManifestEntry(Manifest currentManifest, Manifest originalManifest, String path)Adds a manifest:file-entry for a package part written from the in-memory model (image, OLE object, embedded document).protected voidaddMimeTypeFile(String mimeTypeValue)Gets the attributed texts.abstract byte[]getBytes()Gets the bytes.Gets the common styles.Gets the configurations.abstract List<IContentElement>Gets the content elements.Gets the creation date.Gets the creator.Gets the custom file table.Gets the description.intGets the editing cycles.Gets the editing duration.Gets the fields.Gets the file input table.Gets the generator.Gets the headings.Gets the images.Gets the initial creator.Gets the input file table.abstract InputStreamGets the input stream.Gets the keywords.Gets the language.Gets the last modified.getLists()Gets the lists.Gets the manifest.Gets the meta data.Gets the mime type.Gets the paragraphs.getPreservedPackageParts(SharedObjects sharedObjects)Returns the paths of original package parts that this writer does NOT regenerate (thumbnails, layout-cache, manifest.rdf, unreferenced pictures, ...) so they can be carried over into the saved package instead of being dropped.Gets the prints the date.Gets the printed by.Gets the sections.Gets the statistic.Gets the subject.Gets the tables.Gets the template.getTexts()Gets the texts.getTitle()Gets the title.Gets the user defined metadata elements.booleanChecks if is template.abstract voidopen(InputStream stream)Open.abstract voidOpen.protected voidopenImplementation(InputStream stream)voidReplace.voidReplace.abstract voidsave(OutputStream stream)Save.abstract voidSave.abstract voidSave.voidsetCreationDate(Date creationDate)Sets the creation date.voidsetCreator(String creator)Sets the creator.voidsetDescription(String description)Sets the description.voidsetEditingCycles(int editingCycles)Sets the editing cycles.voidsetEditingDuration(String editingDuration)Sets the editing duration.voidsetInitialCreator(String initialCreator)Sets the initial creator.voidsetKeywords(String keywords)Sets the keywords.voidsetLanguage(String language)Sets the language.voidsetLastModified(Date lastModified)Sets the last modified.voidsetMimeType(String mimeType)Sets the mime type.voidsetPrintDate(Date printDate)Sets the prints the date.voidsetPrintedBy(String printedBy)Sets the printed by.voidsetStatistic(DocumentStatistic statistic)Sets the statistic.voidsetSubject(String subject)Sets the subject.voidsetTemplate(boolean isTemplate)Sets the template.voidsetTemplate(Template template)Sets the template.voidSets the title.
-
Field Details
-
utf8
-
outputStream
-
inputFileTable
-
customFileTable
-
mimeType
-
isTemplate
protected boolean isTemplate -
manifest
-
metaData
-
commonStyles
-
settings
-
-
Constructor Details
-
Document
public Document()
-
-
Method Details
-
open
Open.- Parameters:
file- the file- Throws:
IOException- Signals that an I/O exception has occurred.XMLStreamException- the xML stream exception
-
open
Open.- Parameters:
stream- the stream- Throws:
IOException- Signals that an I/O exception has occurred.XMLStreamException- the xML stream exception
-
save
Save.- Parameters:
file- the file- Throws:
IOException- Signals that an I/O exception has occurred.
-
save
Save.- Parameters:
file- the fileoverwrite- the overwrite- Throws:
IOException- Signals that an I/O exception has occurred.
-
save
Save.- Parameters:
stream- the stream- Throws:
IOException- Signals that an I/O exception has occurred.
-
getBytes
Gets the bytes.- Returns:
- the bytes
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getInputStream
Gets the input stream.- Returns:
- the input stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
openImplementation
- Throws:
IOExceptionXMLStreamException
-
addFile
- Throws:
IOException
-
addManifestEntry
Adds a manifest:file-entry for a package part written from the in-memory model (image, OLE object, embedded document). Without it the part is unlisted and the package can be reported as corrupt. The original manifest (if any) supplies the exact media-type; otherwise it is derived from the file extension. -
addMimeTypeFile
- Throws:
IOException
-
addFile
- Throws:
IOException
-
getAttributedTexts
Gets the attributed texts.- Returns:
- the attributed texts
-
getTexts
Gets the texts.- Returns:
- the texts
-
getParagraphs
Gets the paragraphs.- Returns:
- the paragraphs
-
getHeadings
Gets the headings.- Returns:
- the headings
-
getFields
Gets the fields.- Returns:
- the fields
-
getLists
Gets the lists.- Returns:
- the lists
-
getSections
Gets the sections.- Returns:
- the sections
-
getTables
Gets the tables.- Returns:
- the tables
-
getImages
Gets the images.- Returns:
- the images
-
replace
Replace.- Parameters:
oldText- the old textnewText- the new text
-
replace
Replace.- Parameters:
oldText- the old textnewText- the new textincludeHeaderFooter- replace in headers and footers also
-
getContentElements
Gets the content elements.- Returns:
- the content elements
-
getInputFileTable
Gets the input file table.- Returns:
- the input file table
-
getCustomFileTable
Gets the custom file table.- Returns:
- the custom file table
-
getCommonStyles
Gets the common styles.- Returns:
- the common styles
-
getGenerator
Gets the generator.- Returns:
- the generator
-
getTitle
Gets the title.- Returns:
- the title
-
setTitle
Sets the title.- Parameters:
title- the new title
-
getDescription
Gets the description.- Returns:
- the description
-
setDescription
Sets the description.- Parameters:
description- the new description
-
getSubject
Gets the subject.- Returns:
- the subject
-
setSubject
Sets the subject.- Parameters:
subject- the new subject
-
getLanguage
Gets the language.- Returns:
- the language
-
setLanguage
Sets the language.- Parameters:
language- the new language
-
getKeywords
Gets the keywords.- Returns:
- the keywords
-
setKeywords
Sets the keywords.- Parameters:
keywords- the new keywords
-
getCreator
Gets the creator.- Returns:
- the creator
-
setCreator
Sets the creator.- Parameters:
creator- the new creator
-
getCreationDate
Gets the creation date.- Returns:
- the creation date
-
setCreationDate
Sets the creation date.- Parameters:
creationDate- the new creation date
-
getLastModified
Gets the last modified.- Returns:
- the last modified
-
setLastModified
Sets the last modified.- Parameters:
lastModified- the new last modified
-
getEditingCycles
public int getEditingCycles()Gets the editing cycles.- Returns:
- the editing cycles
-
setEditingCycles
public void setEditingCycles(int editingCycles)Sets the editing cycles.- Parameters:
editingCycles- the new editing cycles
-
getEditingDuration
Gets the editing duration.- Returns:
- the editing duration
-
setEditingDuration
Sets the editing duration.- Parameters:
editingDuration- the new editing duration
-
getInitialCreator
Gets the initial creator.- Returns:
- the initial creator
-
setInitialCreator
Sets the initial creator.- Parameters:
initialCreator- the new initial creator
-
getPrintDate
Gets the prints the date.- Returns:
- the prints the date
-
setPrintDate
Sets the prints the date.- Parameters:
printDate- the new prints the date
-
getPrintedBy
Gets the printed by.- Returns:
- the printed by
-
setPrintedBy
Sets the printed by.- Parameters:
printedBy- the new printed by
-
getUserDefinedMetadataElements
Gets the user defined metadata elements.- Returns:
- the user defined metadata elements
-
getTemplate
Gets the template.- Returns:
- the template
-
setTemplate
Sets the template.- Parameters:
template- the new template
-
getStatistic
Gets the statistic.- Returns:
- the statistic
-
setStatistic
Sets the statistic.- Parameters:
statistic- the new statistic
-
getConfigurations
Gets the configurations.- Returns:
- the configurations
-
isTemplate
public boolean isTemplate()Checks if is template.- Returns:
- true, if is template
-
setTemplate
public void setTemplate(boolean isTemplate)Sets the template.- Parameters:
isTemplate- the new template
-
getFileInputTable
Gets the file input table.- Returns:
- the file input table
-
getManifest
Gets the manifest.- Returns:
- the manifest
-
getMetaData
Gets the meta data.- Returns:
- the meta data
-
getMimeType
Gets the mime type.- Returns:
- the mime type
-
setMimeType
Sets the mime type.- Parameters:
mimeType- the new mime type
-