Package com.independentsoft.office.odf
Class Spreadsheet
java.lang.Object
com.independentsoft.office.odf.Document
com.independentsoft.office.odf.Spreadsheet
The Class Spreadsheet.
-
Field Summary
Fields inherited from class com.independentsoft.office.odf.Document
commonStyles, customFileTable, inputFileTable, isTemplate, manifest, metaData, mimeType, outputStream, settings, utf8 -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new spreadsheet, seeded with the one table a usable .ods needs.Spreadsheet(InputStream inputStream)Instantiates a new spreadsheet.Spreadsheet(String file)Instantiates a new spreadsheet.Spreadsheet(String folder, FileTable inputFileTable)Instantiates a new spreadsheet. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a new object that is a deep copy of the current instance.Gets the automatic styles.byte[]getBytes()Gets the bytes.Gets the calculation settings.Gets the content.Returns all content elements.Gets the content validations.getCsv()Returns the content of all tables as comma separated values.Gets the database ranges.getFonts()Gets the fonts.getHtml()Converts the document to HTML format.Gets the input stream.doubleGets the iteration maximum difference.intGets the iteration step.Gets the label ranges.Gets the named elements.Gets the office scripts.Gets the protection key.Gets the start date.Gets the start date type.intGets the start year.Gets the tables.booleanChecks if is apply search criteria to whole cell.booleanChecks if is automatically find labels.booleanChecks if is case sensitive.booleanChecks if is iteration status.booleanChecks if is protected.voidopen(InputStream inputStream)Open.voidOpen.protected voidopenImplementation(InputStream inputStream)voidrenameStyle(Style style, String newName)Rename style.voidsave(OutputStream outputStream)Save.voidSave.voidSave.voidsaveAsHtml(OutputStream stream)Saves the document in HTML format.voidsaveAsHtml(String file)Saves the document in HTML format.voidsaveAsHtml(String file, boolean overwrite)Saves the document in HTML format.voidsetApplySearchCriteriaToWholeCell(boolean applySearchCriteriaToWholeCell)Sets the apply search criteria to whole cell.voidsetAutomaticallyFindLabels(boolean automaticallyFindLabels)Sets the automatically find labels.voidsetCaseSensitive(boolean isCaseSensitive)Sets the case sensitive.voidsetIterationMaximumDifference(double iterationMaximumDifference)Sets the iteration maximum difference.voidsetIterationStatus(boolean iterationStatus)Sets the iteration status.voidsetIterationStep(int iterationStep)Sets the iteration step.voidsetProtected(boolean isProtected)Sets the protected.voidsetProtectionKey(String protectionKey)Sets the protection key.voidsetStartDate(String startDate)Sets the start date.voidsetStartDateType(CellValueType startDateType)Sets the start date type.voidsetStartYear(int startYear)Sets the start year.voidsetUsePrecisionAsShown(boolean usePrecisionAsShown)Sets the use precision as shown.voidsetUseRegularExpressions(boolean useRegularExpressions)Sets the use regular expressions.booleanUse precision as shown.booleanUse regular expressions.validate()Checks the spreadsheet for the things that make an .ods unusable or non-conforming, and returns what it finds.Methods inherited from class com.independentsoft.office.odf.Document
addFile, addFile, addManifestEntry, addMimeTypeFile, addPreservedEmbeddedObjectManifestEntries, find, find, findElements, findElements, findElements, findFirst, findFirst, getAttributedTexts, getCommonStyles, getConfigurations, getCreationDate, getCreator, getCustomFileTable, getDescription, getEditingCycles, getEditingDuration, getFields, getFileInputTable, getGenerator, getHeadings, getImages, getInitialCreator, getInputFileTable, getKeywords, getLanguage, getLastModified, getLists, getManifest, getMetaData, getMimeType, getParagraphs, getPreservedPackageParts, getPrintDate, getPrintedBy, getSections, getStatistic, getSubject, getTemplate, getText, getTexts, getTitle, getUserDefinedMetadataElements, isTemplate, remove, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replaceContent, setCreationDate, setCreator, setDescription, setEditingCycles, setEditingDuration, setInitialCreator, setKeywords, setLanguage, setLastModified, setMimeType, setPrintDate, setPrintedBy, setStatistic, setSubject, setTemplate, setTemplate, setTitle
-
Constructor Details
-
Spreadsheet
public Spreadsheet()Instantiates a new spreadsheet, seeded with the one table a usable .ods needs. The schema tolerates a spreadsheet with no tables, but nothing can be put in it and no application shows anything, so a new document starts the way Calc starts one. -
Spreadsheet
Instantiates a new spreadsheet.- Parameters:
file- the file- Throws:
IOException- Signals that an I/O exception has occurred.XMLStreamException- the xML stream exception
-
Spreadsheet
Instantiates a new spreadsheet.- Parameters:
inputStream- the input stream- Throws:
IOException- Signals that an I/O exception has occurred.XMLStreamException- the xML stream exception
-
Spreadsheet
Instantiates a new spreadsheet.- Parameters:
folder- the folderinputFileTable- the input file table- Throws:
IOException- Signals that an I/O exception has occurred.XMLStreamException- the xML stream exception
-
-
Method Details
-
validate
Checks the spreadsheet for the things that make an .ods unusable or non-conforming, and returns what it finds. An empty list means nothing known is wrong. This is NOT a schema validator - OpenDocument is defined in RELAX NG and validating against it needs the schema itself; see tools/odf-validate. This knows the invariants the object model can express, and nothing beyond them.- Returns:
- the problems found, in document order. Never null.
-
open
Description copied from class:DocumentOpen.- Specified by:
openin classDocument- Parameters:
filePath- the file- Throws:
IOException- Signals that an I/O exception has occurred.XMLStreamException- the xML stream exception
-
open
Description copied from class:DocumentOpen.- Specified by:
openin classDocument- Parameters:
inputStream- the stream- Throws:
IOException- Signals that an I/O exception has occurred.XMLStreamException- the xML stream exception
-
openImplementation
- Overrides:
openImplementationin classDocument- Throws:
IOExceptionXMLStreamException
-
renameStyle
Rename style.- Parameters:
style- the stylenewName- the new name
-
getContentElements
Returns all content elements.- Specified by:
getContentElementsin classDocument- Returns:
- A collection of content elements.
-
clone
Creates a new object that is a deep copy of the current instance. -
save
Description copied from class:DocumentSave.- Specified by:
savein classDocument- Parameters:
filePath- the file- Throws:
IOException- Signals that an I/O exception has occurred.
-
save
Description copied from class:DocumentSave.- Specified by:
savein classDocument- Parameters:
filePath- the fileoverwrite- the overwrite- Throws:
IOException- Signals that an I/O exception has occurred.
-
save
Description copied from class:DocumentSave.- Specified by:
savein classDocument- Parameters:
outputStream- the stream- Throws:
IOException- Signals that an I/O exception has occurred.
-
getInputStream
Description copied from class:DocumentGets the input stream.- Specified by:
getInputStreamin classDocument- Returns:
- the input stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getBytes
Description copied from class:DocumentGets the bytes.- Specified by:
getBytesin classDocument- Returns:
- the bytes
- Throws:
IOException- Signals that an I/O exception has occurred.
-
saveAsHtml
Saves the document in HTML format.- Specified by:
saveAsHtmlin classDocument- Parameters:
file- The path of the file to save.- Throws:
IOException- Signals that an I/O exception has occurred.
-
saveAsHtml
Saves the document in HTML format.- Specified by:
saveAsHtmlin classDocument- Parameters:
file- The path of the file to save.overwrite- If true, overwrites an existing file.- Throws:
IOException- Signals that an I/O exception has occurred.
-
saveAsHtml
Saves the document in HTML format.- Specified by:
saveAsHtmlin classDocument- Parameters:
stream- The stream to save to.- Throws:
IOException- Signals that an I/O exception has occurred.
-
getHtml
Converts the document to HTML format.- Specified by:
getHtmlin classDocument- Returns:
- The HTML representation of the document.
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getTables
Description copied from class:DocumentGets the tables. -
getCsv
Returns the content of all tables as comma separated values. Each table is preceded by an empty line and its name, the cells of a row are separated by a comma and the rows are separated by a line break. A field which contains a comma, a quotation mark or a line break is enclosed in quotation marks and an embedded quotation mark is doubled, as specified by RFC 4180. The empty cells and rows a table is padded with are not written.- Returns:
- the comma separated values of all tables
-
getNamedElements
Gets the named elements.- Returns:
- the named elements
-
getDatabaseRanges
Gets the database ranges.- Returns:
- the database ranges
-
isProtected
public boolean isProtected()Checks if is protected.- Returns:
- true, if is protected
-
setProtected
public void setProtected(boolean isProtected)Sets the protected.- Parameters:
isProtected- the new protected
-
getProtectionKey
Gets the protection key.- Returns:
- the protection key
-
setProtectionKey
Sets the protection key.- Parameters:
protectionKey- the new protection key
-
isCaseSensitive
public boolean isCaseSensitive()Checks if is case sensitive.- Returns:
- true, if is case sensitive
-
setCaseSensitive
public void setCaseSensitive(boolean isCaseSensitive)Sets the case sensitive.- Parameters:
isCaseSensitive- the new case sensitive
-
usePrecisionAsShown
public boolean usePrecisionAsShown()Use precision as shown.- Returns:
- true, if successful
-
setUsePrecisionAsShown
public void setUsePrecisionAsShown(boolean usePrecisionAsShown)Sets the use precision as shown.- Parameters:
usePrecisionAsShown- the new use precision as shown
-
isApplySearchCriteriaToWholeCell
public boolean isApplySearchCriteriaToWholeCell()Checks if is apply search criteria to whole cell.- Returns:
- true, if is apply search criteria to whole cell
-
setApplySearchCriteriaToWholeCell
public void setApplySearchCriteriaToWholeCell(boolean applySearchCriteriaToWholeCell)Sets the apply search criteria to whole cell.- Parameters:
applySearchCriteriaToWholeCell- the new apply search criteria to whole cell
-
isAutomaticallyFindLabels
public boolean isAutomaticallyFindLabels()Checks if is automatically find labels.- Returns:
- true, if is automatically find labels
-
setAutomaticallyFindLabels
public void setAutomaticallyFindLabels(boolean automaticallyFindLabels)Sets the automatically find labels.- Parameters:
automaticallyFindLabels- the new automatically find labels
-
useRegularExpressions
public boolean useRegularExpressions()Use regular expressions.- Returns:
- true, if successful
-
setUseRegularExpressions
public void setUseRegularExpressions(boolean useRegularExpressions)Sets the use regular expressions.- Parameters:
useRegularExpressions- the new use regular expressions
-
getStartYear
public int getStartYear()Gets the start year.- Returns:
- the start year
-
setStartYear
public void setStartYear(int startYear)Sets the start year.- Parameters:
startYear- the new start year
-
getStartDateType
Gets the start date type.- Returns:
- the start date type
-
setStartDateType
Sets the start date type.- Parameters:
startDateType- the new start date type
-
getStartDate
Gets the start date.- Returns:
- the start date
-
setStartDate
Sets the start date.- Parameters:
startDate- the new start date
-
isIterationStatus
public boolean isIterationStatus()Checks if is iteration status.- Returns:
- true, if is iteration status
-
setIterationStatus
public void setIterationStatus(boolean iterationStatus)Sets the iteration status.- Parameters:
iterationStatus- the new iteration status
-
getIterationStep
public int getIterationStep()Gets the iteration step.- Returns:
- the iteration step
-
setIterationStep
public void setIterationStep(int iterationStep)Sets the iteration step.- Parameters:
iterationStep- the new iteration step
-
getIterationMaximumDifference
public double getIterationMaximumDifference()Gets the iteration maximum difference.- Returns:
- the iteration maximum difference
-
setIterationMaximumDifference
public void setIterationMaximumDifference(double iterationMaximumDifference)Sets the iteration maximum difference.- Parameters:
iterationMaximumDifference- the new iteration maximum difference
-
getFonts
Gets the fonts.- Returns:
- the fonts
-
getOfficeScripts
Gets the office scripts.- Returns:
- the office scripts
-
getAutomaticStyles
Gets the automatic styles.- Returns:
- the automatic styles
-
getCalculationSettings
Gets the calculation settings.- Returns:
- the calculation settings
-
getLabelRanges
Gets the label ranges.- Returns:
- the label ranges
-
getContentValidations
Gets the content validations.- Returns:
- the content validations
-
getContent
Gets the content.- Returns:
- the content
-