public class ContentTypeManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CONTENT_TYPES_PART_NAME
Content type part name.
|
protected static org.slf4j.Logger |
log |
static String |
TYPES_NAMESPACE_URI
Content type namespace
|
| Constructor and Description |
|---|
ContentTypeManager() |
protected static org.slf4j.Logger log
public static final String CONTENT_TYPES_PART_NAME
public static final String TYPES_NAMESPACE_URI
public TreeMap<String,CTDefault> getDefaultContentType()
public TreeMap<URI,CTOverride> getOverrideContentType()
public void addOverrideContentType(URI partUri, CTOverride contentType)
partUri - Uri of the part.contentType - Content type of the part.public Part getPart(String partName, Relationship rel) throws URISyntaxException, PartUnrecognisedException, InvalidFormatException
public Part newPartForContentType(String contentType, String partName, Relationship rel) throws InvalidFormatException, PartUnrecognisedException
public Part CreateDefaultXmlPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateMainDocumentPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateStyleDefinitionsPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateDocumentSettingsPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateWebSettingsPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateFontTablePartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateThemePartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateDocPropsCorePartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateDocPropsExtendedPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateDocPropsCustomPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateCommentsPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateCustomXmlDataStoragePropertiesPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateEndnotesPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateFooterPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateFootnotesPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateGlossaryDocumentPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateHeaderPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateNumberingPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic Part CreateObfuscatedFontPartObject(String partName) throws InvalidFormatException
InvalidFormatExceptionpublic void addDefaultContentType(String extension, CTDefault contentType)
extension - The part name extension to bind to a content type.contentType - The content type associated with the specified extension.public void addOverrideContentType(PartName partName, String contentType)
partName - contentType - @Deprecated public void removeContentType(PartName partName)
partUri - The part URI associated with the override content type to
delete.public void removeOverrideContentType(PartName partName)
partUri - The part URI associated with the override content type to
delete.public void removeDefaultContentType(String ext)
partUri - The part URI associated with the override content type to
delete.public boolean isContentTypeRegistered(String contentType)
contentType - The content type to check.true if the specified content type is already
registered, then false.public boolean isOverrideContentTypeRegistered(String contentType)
contentType - The content type to check.true if the specified content type is already
registered, then false.public String getContentType(PartName partName)
partUri - The URI part to check.null.public void clearAll()
public void clearOverrideContentTypes()
public void parseContentTypesFile(InputStream contentTypes) throws InvalidFormatException
InvalidFormatExceptionpublic void marshal(Node node) throws JAXBException
JAXBExceptionpublic void marshal(OutputStream os) throws JAXBException
JAXBExceptionpublic OpcPackage createPackage(String pkgContentType) throws InvalidFormatException
InvalidFormatExceptionpublic boolean isContentEqual(ContentTypeManager other) throws Docx4JException
Docx4JExceptionCopyright © 2007-2022. All Rights Reserved.