Class SpreadsheetMLPackage
java.lang.Object
org.docx4j.openpackaging.Base
org.docx4j.openpackaging.packages.OpcPackage
org.docx4j.openpackaging.packages.SpreadsheetMLPackage
- All Implemented Interfaces:
PackageIdentifier
- Author:
- jharrop
-
Field Summary
FieldsFields inherited from class org.docx4j.openpackaging.packages.OpcPackage
contentTypeManager, customXmlDataStorageParts, docPropsCorePart, docPropsCustomPart, docPropsExtendedPart, externalResources, handled, partsFields inherited from class org.docx4j.openpackaging.Base
contentType, partName, relationships -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.SpreadsheetMLPackage(ContentTypeManager contentTypeManager) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic SpreadsheetMLPackageCreate an empty presentation.createWorksheetPart(PartName partName, String sheetName, long sheetId) Create a worksheet and add it to the packagestatic SpreadsheetMLPackageConvenience method to create a SpreadsheetMLPackage from an existing File (.xlsx or .xml Flat OPC).static SpreadsheetMLPackageload(InputStream xlsxInputStream) Creates aSpreadsheetMLPackagefrom anInputStream.static voidvoidreset()Reinit fields so this pkg object can be re-used.booleansetPartShortcut(Part part, String relationshipType) Tell the source Part about this target Part, so the source can use this part via a convenience method.Methods inherited from class org.docx4j.openpackaging.packages.OpcPackage
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, setTitleMethods inherited from class org.docx4j.openpackaging.Base
addTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, setContentType, setPartName, setRelationships, setUserData
-
Field Details
-
log
protected static org.slf4j.Logger log
-
-
Constructor Details
-
SpreadsheetMLPackage
public SpreadsheetMLPackage()Constructor. Also creates a new content type manager -
SpreadsheetMLPackage
Constructor.- Parameters:
contentTypeManager- The content type manager to use
-
-
Method Details
-
getProtectionSettings
-
getWorkbookPart
-
load
Convenience method to create a SpreadsheetMLPackage from an existing File (.xlsx or .xml Flat OPC).- Parameters:
xlsxFile- The xlsx file- Throws:
Docx4JException
-
load
Creates aSpreadsheetMLPackagefrom anInputStream.- Parameters:
xlsxInputStream- anInputStreamof an .xlsx file- Returns:
- a
PresentationMLPackagerepresenting the .xlsx file - Throws:
Docx4JException- if an exception is encountered in processing
-
setPartShortcut
Description copied from class:BaseTell the source Part about this target Part, so the source can use this part via a convenience method.- Overrides:
setPartShortcutin classOpcPackage- Returns:
- true if the source Part does use the target Part in a convenience method.
-
createPackage
Create an empty presentation.- Returns:
- Throws:
InvalidFormatException
-
createWorksheetPart
public WorksheetPart createWorksheetPart(PartName partName, String sheetName, long sheetId) throws InvalidFormatException, jakarta.xml.bind.JAXBException Create a worksheet and add it to the package- Parameters:
wb-partName-sheetName-sheetId-- Returns:
- Throws:
InvalidFormatExceptionjakarta.xml.bind.JAXBException
-
reset
public void reset()Reinit fields so this pkg object can be re-used.- Overrides:
resetin classOpcPackage- Since:
- 3.3.7
-
main
- Throws:
Exception
-