Class PartialDeepCopy
java.lang.Object
org.docx4j.convert.out.common.preprocess.PartialDeepCopy
public class PartialDeepCopy
extends java.lang.Object
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 Modifier and Type Field Description protected static org.slf4j.Logger
log
-
Constructor Summary
Constructors Constructor Description PartialDeepCopy()
-
Method Summary
Modifier and Type Method Description protected static Part
copyPart(Part part, OpcPackage targetPackage, boolean deepCopy)
protected static OpcPackage
createPackage(OpcPackage opcPackage)
protected static void
deepCopyContent(Part source, Part destination)
protected static Part
deepCopyPart(OpcPackage opcPackage, Base targetParent, Part sourcePart, java.util.Set<java.lang.String> relationshipTypes)
protected static void
deepCopyRelationships(OpcPackage opcPackage, Base sourcePart, Base targetPart, java.util.Set<java.lang.String> relationshipTypes)
static OpcPackage
process(OpcPackage opcPackage, java.util.Set<java.lang.String> relationshipTypes)
protected static void
shallowCopyContent(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, java.util.Set<java.lang.String> relationshipTypes) throws Docx4JException- Throws:
Docx4JException
-
createPackage
- Throws:
Docx4JException
-
deepCopyRelationships
protected static void deepCopyRelationships(OpcPackage opcPackage, Base sourcePart, Base targetPart, java.util.Set<java.lang.String> relationshipTypes) throws Docx4JException- Throws:
Docx4JException
-
deepCopyPart
protected static Part deepCopyPart(OpcPackage opcPackage, Base targetParent, Part sourcePart, java.util.Set<java.lang.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
-