|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.docx4j.openpackaging.contenttype.ContentTypeManagerImpl
public class ContentTypeManagerImpl
Manage package content types ([Content_Types].xml ) .
| Field Summary | |
|---|---|
static java.lang.String |
CONTENT_TYPES_PART_NAME
Content type part name. |
static java.lang.String |
TYPES_NAMESPACE_URI
Content type namespace |
| Constructor Summary | |
|---|---|
ContentTypeManagerImpl()
|
|
ContentTypeManagerImpl(org.dom4j.Document contentTypes)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addContentType(PartName partName,
java.lang.String contentType)
Build association extention-> content type (will be stored in [Content_Types].xml) for example ContentType="image/png" Extension="png" |
void |
addDefaultContentType(java.lang.String extension,
java.lang.String contentType)
Add a content type associated with the specified extension. |
void |
addOverrideContentType(java.net.URI partUri,
java.lang.String contentType)
Add an override content type for a specific part. |
void |
clearAll()
Clear all content types. |
void |
clearOverrideContentTypes()
Clear all override content types. |
Part |
CreateCommentsPartObject(java.lang.String partName)
|
Part |
CreateCustomXmlPropertiesPartObject(java.lang.String partName)
|
Part |
CreateDefaultPartObject(java.lang.String partName)
|
Part |
CreateDocPropsCorePartObject(java.lang.String partName)
|
Part |
CreateDocPropsCustomPartObject(java.lang.String partName)
|
Part |
CreateDocPropsExtendedPartObject(java.lang.String partName)
|
Part |
CreateDocumentSettingsPartObject(java.lang.String partName)
|
Part |
CreateEndnotesPartObject(java.lang.String partName)
|
Part |
CreateFontTablePartObject(java.lang.String partName)
|
Part |
CreateFooterPartObject(java.lang.String partName)
|
Part |
CreateFootnotesPartObject(java.lang.String partName)
|
Part |
CreateGlossaryDocumentPartObject(java.lang.String partName)
|
Part |
CreateHeaderPartObject(java.lang.String partName)
|
Part |
CreateMainDocumentPartObject(java.lang.String partName)
|
Part |
CreateNumberingPartObject(java.lang.String partName)
|
Part |
CreateObfuscatedFontPartObject(java.lang.String partName)
|
Package |
createPackage()
|
Part |
CreateStyleDefinitionsPartObject(java.lang.String partName)
|
Part |
CreateThemePartObject(java.lang.String partName)
|
Part |
CreateWebSettingsPartObject(java.lang.String partName)
|
java.lang.String |
getContentType(PartName partName)
Get the content type for the specified part, if any. |
org.dom4j.Document |
getDocument()
Generates the XML for the contents type part. |
Part |
getPart(java.lang.String partName)
|
java.net.URI |
getPartNameOverridenByContentType(java.lang.String contentType)
|
boolean |
isContentTypeRegistered(java.lang.String contentType)
Check if the specified content type is already register. |
Part |
newPartForContentType(java.lang.String contentType,
java.lang.String partName)
|
void |
parseContentTypesFile(org.dom4j.Document xmlContentTypeDoc)
Parse the content types part. |
void |
removeContentType(PartName partName)
Delete a content type based on the specified part name. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CONTENT_TYPES_PART_NAME
public static final java.lang.String TYPES_NAMESPACE_URI
| Constructor Detail |
|---|
public ContentTypeManagerImpl()
public ContentTypeManagerImpl(org.dom4j.Document contentTypes)
throws InvalidFormatException
archive - If different of null then the content types part is
retrieve and parse.
InvalidFormatException - If the content types part content is not valid.| Method Detail |
|---|
public void addContentType(PartName partName,
java.lang.String contentType)
addContentType in interface ContentTypeManagerpartUri - the uri that will be stored
public void addDefaultContentType(java.lang.String extension,
java.lang.String contentType)
addDefaultContentType in interface ContentTypeManagerextension - The part name extension to bind to a content type.contentType - The content type associated with the specified extension.
public void addOverrideContentType(java.net.URI partUri,
java.lang.String contentType)
addOverrideContentType in interface ContentTypeManagerpartUri - Uri of the part.contentType - Content type of the part.public void clearAll()
clearAll in interface ContentTypeManagerpublic void clearOverrideContentTypes()
clearOverrideContentTypes in interface ContentTypeManager
public Part CreateCommentsPartObject(java.lang.String partName)
throws InvalidFormatException
CreateCommentsPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateCustomXmlPropertiesPartObject(java.lang.String partName)
throws InvalidFormatException
CreateCustomXmlPropertiesPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateDefaultPartObject(java.lang.String partName)
throws InvalidFormatException
CreateDefaultPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateDocPropsCorePartObject(java.lang.String partName)
throws InvalidFormatException
CreateDocPropsCorePartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateDocPropsCustomPartObject(java.lang.String partName)
throws InvalidFormatException
CreateDocPropsCustomPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateDocPropsExtendedPartObject(java.lang.String partName)
throws InvalidFormatException
CreateDocPropsExtendedPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateDocumentSettingsPartObject(java.lang.String partName)
throws InvalidFormatException
CreateDocumentSettingsPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateEndnotesPartObject(java.lang.String partName)
throws InvalidFormatException
CreateEndnotesPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateFontTablePartObject(java.lang.String partName)
throws InvalidFormatException
CreateFontTablePartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateFooterPartObject(java.lang.String partName)
throws InvalidFormatException
CreateFooterPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateFootnotesPartObject(java.lang.String partName)
throws InvalidFormatException
CreateFootnotesPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateGlossaryDocumentPartObject(java.lang.String partName)
throws InvalidFormatException
CreateGlossaryDocumentPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateHeaderPartObject(java.lang.String partName)
throws InvalidFormatException
CreateHeaderPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateMainDocumentPartObject(java.lang.String partName)
throws InvalidFormatException
CreateMainDocumentPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateNumberingPartObject(java.lang.String partName)
throws InvalidFormatException
CreateNumberingPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateObfuscatedFontPartObject(java.lang.String partName)
throws InvalidFormatException
CreateObfuscatedFontPartObject in interface ContentTypeManagerInvalidFormatException
public Package createPackage()
throws InvalidFormatException
createPackage in interface ContentTypeManagerInvalidFormatException
public Part CreateStyleDefinitionsPartObject(java.lang.String partName)
throws InvalidFormatException
CreateStyleDefinitionsPartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateThemePartObject(java.lang.String partName)
throws InvalidFormatException
CreateThemePartObject in interface ContentTypeManagerInvalidFormatException
public Part CreateWebSettingsPartObject(java.lang.String partName)
throws InvalidFormatException
CreateWebSettingsPartObject in interface ContentTypeManagerInvalidFormatExceptionpublic java.lang.String getContentType(PartName partName)
getContentType in interface ContentTypeManagerpartUri - The URI part to check.
null.public org.dom4j.Document getDocument()
getDocument in interface ContentTypeManageroutStream - The output stream use to save the XML content of the content
types part.
public Part getPart(java.lang.String partName)
throws java.net.URISyntaxException,
InvalidFormatException
getPart in interface ContentTypeManagerjava.net.URISyntaxException
InvalidFormatExceptionpublic java.net.URI getPartNameOverridenByContentType(java.lang.String contentType)
getPartNameOverridenByContentType in interface ContentTypeManagerpublic boolean isContentTypeRegistered(java.lang.String contentType)
isContentTypeRegistered in interface ContentTypeManagercontentType - The content type to check.
true if the specified content type is already
register, then false.
public Part newPartForContentType(java.lang.String contentType,
java.lang.String partName)
throws InvalidFormatException
newPartForContentType in interface ContentTypeManagerInvalidFormatException
public void parseContentTypesFile(org.dom4j.Document xmlContentTypeDoc)
throws InvalidFormatException
parseContentTypesFile in interface ContentTypeManagerInvalidFormatException - Throws if the content type doesn't exist or the XML format is
invalid.public void removeContentType(PartName partName)
removeContentType in interface ContentTypeManagerpartUri - The part URI associated with the override content type to
delete.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||