public abstract class AbstractConversionImageHandler extends java.lang.Object implements ConversionImageHandler
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
handledImagesMap |
protected java.lang.String |
imageDirPath |
protected boolean |
includeUUID |
protected static org.slf4j.Logger |
log |
protected java.lang.String |
uuid |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractConversionImageHandler(java.lang.String imageDirPath,
boolean includeUUID)
Creates an AbstractConversionImageHandler
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
If the instance is reused, it should be cleared first
|
protected java.lang.String |
createEncodedImage(BinaryPart binaryPart,
byte[] bytes) |
protected java.lang.String |
createKey(Relationship relationship,
BinaryPart part) |
protected abstract java.lang.String |
createStoredImage(BinaryPart binaryPart,
byte[] bytes) |
protected java.lang.String |
doHandleImage(AbstractWordXmlPicture picture,
Relationship relationship,
BinaryPart part) |
protected byte[] |
getImageData(BinaryPart binaryPart)
Get the image data of the buffer
|
protected java.lang.String |
getImageName(BinaryPart binaryPart)
Get the image base name
|
protected java.lang.String |
handleExternalImage(AbstractWordXmlPicture picture,
Relationship relationship,
BinaryPart part) |
java.lang.String |
handleImage(AbstractWordXmlPicture picture,
Relationship relationship,
BinaryPart part) |
protected java.lang.String |
handleInternalImage(AbstractWordXmlPicture picture,
Relationship relationship,
BinaryPart binaryPart) |
protected boolean |
isInternalImage(AbstractWordXmlPicture picture,
Relationship relationship,
BinaryPart part) |
protected java.lang.String |
setupImageName(BinaryPart binaryPart) |
protected static org.slf4j.Logger log
protected java.lang.String uuid
protected java.util.Map<java.lang.String,java.lang.String> handledImagesMap
protected java.lang.String imageDirPath
protected boolean includeUUID
protected AbstractConversionImageHandler(java.lang.String imageDirPath,
boolean includeUUID)
imageDirPath, - the path, where the images will be storedincludeUUID, - should the image names be prefixed with an UUID to differentiate different runspublic java.lang.String handleImage(AbstractWordXmlPicture picture, Relationship relationship, BinaryPart part) throws Docx4JException
handleImage in interface ConversionImageHandlerrelationship - of the imagepart - of the image, if it is an internal image, otherwise nullDocx4JException - this exception will be logged, but not propagatedprotected java.lang.String createKey(Relationship relationship, BinaryPart part)
protected java.lang.String doHandleImage(AbstractWordXmlPicture picture, Relationship relationship, BinaryPart part) throws Docx4JException
Docx4JExceptionprotected boolean isInternalImage(AbstractWordXmlPicture picture, Relationship relationship, BinaryPart part) throws Docx4JException
Docx4JExceptionprotected java.lang.String handleInternalImage(AbstractWordXmlPicture picture, Relationship relationship, BinaryPart binaryPart) throws Docx4JException
picture - relationship - binaryPart - Docx4JExceptionprotected abstract java.lang.String createStoredImage(BinaryPart binaryPart, byte[] bytes) throws Docx4JException
Docx4JExceptionprotected java.lang.String createEncodedImage(BinaryPart binaryPart, byte[] bytes) throws Docx4JException
Docx4JExceptionprotected java.lang.String setupImageName(BinaryPart binaryPart)
protected java.lang.String getImageName(BinaryPart binaryPart)
binaryPart - protected byte[] getImageData(BinaryPart binaryPart)
binaryPart - protected java.lang.String handleExternalImage(AbstractWordXmlPicture picture, Relationship relationship, BinaryPart part)
picture - relationship - part - (is always null)public void clear()
Copyright © 2007–2023. All rights reserved.