public class SpreadsheetMLPackage extends OpcPackage
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
contentTypeManager, customXmlDataStorageParts, docPropsCorePart, docPropsCustomPart, docPropsExtendedPart, externalResources, handled, parts
contentType, 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,
String sheetName,
long sheetId)
Create a worksheet and add it to the package
|
ProtectWorkbook |
getProtectionSettings() |
WorkbookPart |
getWorkbookPart() |
static SpreadsheetMLPackage |
load(File xlsxFile)
Convenience method to create a SpreadsheetMLPackage
from an existing File (.xlsx or .xml Flat OPC).
|
static SpreadsheetMLPackage |
load(InputStream xlsxInputStream)
Creates a
SpreadsheetMLPackage from an InputStream . |
static void |
main(String[] args) |
void |
reset()
Reinit fields so this pkg object can be re-used.
|
boolean |
setPartShortcut(Part part,
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, 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, setTitle
addTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, setContentType, setPartName, setRelationships, setUserData
public SpreadsheetMLPackage()
public SpreadsheetMLPackage(ContentTypeManager contentTypeManager)
contentTypeManager
- The content type manager to usepublic ProtectWorkbook getProtectionSettings()
public WorkbookPart getWorkbookPart()
public static SpreadsheetMLPackage load(File xlsxFile) throws Docx4JException
xlsxFile
- The xlsx fileDocx4JException
public static SpreadsheetMLPackage load(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, String relationshipType)
Base
setPartShortcut
in class OpcPackage
public static SpreadsheetMLPackage createPackage() throws InvalidFormatException
InvalidFormatException
public WorksheetPart createWorksheetPart(PartName partName, String sheetName, long sheetId) throws InvalidFormatException, JAXBException
wb
- partName
- sheetName
- sheetId
- InvalidFormatException
JAXBException
public void reset()
reset
in class OpcPackage
Copyright © 2007-2019. All Rights Reserved.