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
InvalidFormatException
public Part CreateMainDocumentPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateStyleDefinitionsPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateDocumentSettingsPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateWebSettingsPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateFontTablePartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateThemePartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateDocPropsCorePartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateDocPropsExtendedPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateDocPropsCustomPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateCommentsPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateCustomXmlDataStoragePropertiesPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateEndnotesPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateFooterPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateFootnotesPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateGlossaryDocumentPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateHeaderPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateNumberingPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public Part CreateObfuscatedFontPartObject(String partName) throws InvalidFormatException
InvalidFormatException
public 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
InvalidFormatException
public void marshal(Node node) throws JAXBException
JAXBException
public void marshal(OutputStream os) throws JAXBException
JAXBException
public OpcPackage createPackage(String pkgContentType) throws InvalidFormatException
InvalidFormatException
public boolean isContentEqual(ContentTypeManager other) throws Docx4JException
Docx4JException
Copyright © 2007-2019. All Rights Reserved.