public class SpreadsheetMLPackage extends OpcPackage
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
log |
contentTypeManager, customXmlDataStorageParts, docPropsCorePart, docPropsCustomPart, docPropsExtendedPart, externalResources, handled, partscontentType, partName, relationships| Constructor and Description |
|---|
SpreadsheetMLPackage()
Constructor.
|
SpreadsheetMLPackage(ContentTypeManager contentTypeManager)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static SpreadsheetMLPackage |
createPackage()
Create an empty presentation.
|
WorksheetPart |
createWorksheetPart(PartName partName,
java.lang.String sheetName,
long sheetId)
Create a worksheet and add it to the package
|
ProtectWorkbook |
getProtectionSettings() |
WorkbookPart |
getWorkbookPart() |
static SpreadsheetMLPackage |
load(java.io.File xlsxFile)
Convenience method to create a SpreadsheetMLPackage
from an existing File (.xlsx or .xml Flat OPC).
|
static SpreadsheetMLPackage |
load(java.io.InputStream xlsxInputStream)
Creates a
SpreadsheetMLPackage from an InputStream. |
static void |
main(java.lang.String[] args) |
void |
reset()
Reinit fields so this pkg object can be re-used.
|
boolean |
setPartShortcut(Part part,
java.lang.String relationshipType)
Tell the source Part about this target Part, so the
source can use this part via a convenience method.
|
addDocPropsCorePart, addDocPropsCustomPart, addDocPropsExtendedPart, clone, cloneAs, getContentTypeManager, getCustomXmlDataStorageParts, getDocPropsCorePart, getDocPropsCustomPart, getDocPropsExtendedPart, getDrawingPropsIdTracker, getExternalResources, getPackage, getParts, getSourcePartStore, getTargetPartStore, getTitle, isNew, load, load, load, load, load, load, load, load, load, load, name, save, save, save, save, save, save, setContentTypeManager, setName, setNew, setSourcePartStore, setTargetPartStore, setTitleaddTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, setContentType, setPartName, setRelationships, setUserDatapublic SpreadsheetMLPackage()
public SpreadsheetMLPackage(ContentTypeManager contentTypeManager)
contentTypeManager - The content type manager to usepublic ProtectWorkbook getProtectionSettings()
public WorkbookPart getWorkbookPart()
public static SpreadsheetMLPackage load(java.io.File xlsxFile) throws Docx4JException
xlsxFile - The xlsx fileDocx4JExceptionpublic static SpreadsheetMLPackage load(java.io.InputStream xlsxInputStream) throws Docx4JException
SpreadsheetMLPackage from an InputStream.xlsxInputStream - an InputStream of an .xlsx filePresentationMLPackage representing the .xlsx fileDocx4JException - if an exception is encountered in processingpublic boolean setPartShortcut(Part part, java.lang.String relationshipType)
BasesetPartShortcut in class OpcPackagepublic static SpreadsheetMLPackage createPackage() throws InvalidFormatException
InvalidFormatExceptionpublic WorksheetPart createWorksheetPart(PartName partName, java.lang.String sheetName, long sheetId) throws InvalidFormatException, javax.xml.bind.JAXBException
wb - partName - sheetName - sheetId - InvalidFormatExceptionjavax.xml.bind.JAXBExceptionpublic void reset()
reset in class OpcPackagepublic static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.ExceptionCopyright © 2007–2023. All rights reserved.