Class PartialDeepCopy
java.lang.Object
org.docx4j.convert.out.common.preprocess.PartialDeepCopy
Create a partial deep copy of the document. All the parts are copied,
as they may have some references to other parts. The data in the parts is
only copied if the relationship type of the part is contained in the passed
relationshipTypes otherwise the new part contains a reference to the data
of the old part.
If the passed relationship types is null, then it will do a complete deep copy. This is probably faster than storing and reading the document but it is restricted to Parts of the types: BinaryPart, JaxbXmlPart, CustomXmlDataStoragePart, XmlPart.
If the passed relationship types is empty, then the passed Package is returned.
If the passed relationship types is null, then it will do a complete deep copy. This is probably faster than storing and reading the document but it is restricted to Parts of the types: BinaryPart, JaxbXmlPart, CustomXmlDataStoragePart, XmlPart.
If the passed relationship types is empty, then the passed Package is returned.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static PartcopyPart(Part part, OpcPackage targetPackage, boolean deepCopy) protected static OpcPackagecreatePackage(OpcPackage opcPackage) protected static voiddeepCopyContent(Part source, Part destination) protected static PartdeepCopyPart(OpcPackage opcPackage, Base targetParent, Part sourcePart, Set<String> relationshipTypes) protected static voiddeepCopyRelationships(OpcPackage opcPackage, Base sourcePart, Base targetPart, Set<String> relationshipTypes) static OpcPackageprocess(OpcPackage opcPackage, Set<String> relationshipTypes) protected static voidshallowCopyContent(Part source, Part destination)
-
Field Details
-
log
protected static org.slf4j.Logger log
-
-
Constructor Details
-
PartialDeepCopy
public PartialDeepCopy()
-
-
Method Details
-
process
public static OpcPackage process(OpcPackage opcPackage, Set<String> relationshipTypes) throws Docx4JException - Throws:
Docx4JException
-
createPackage
- Throws:
Docx4JException
-
deepCopyRelationships
protected static void deepCopyRelationships(OpcPackage opcPackage, Base sourcePart, Base targetPart, Set<String> relationshipTypes) throws Docx4JException - Throws:
Docx4JException
-
deepCopyPart
protected static Part deepCopyPart(OpcPackage opcPackage, Base targetParent, Part sourcePart, Set<String> relationshipTypes) throws Docx4JException - Throws:
Docx4JException
-
copyPart
protected static Part copyPart(Part part, OpcPackage targetPackage, boolean deepCopy) throws Docx4JException - Throws:
Docx4JException
-
deepCopyContent
- Throws:
Docx4JException
-
shallowCopyContent
- Throws:
Docx4JException
-