Class VariablePrepare
java.lang.Object
org.docx4j.model.datastorage.migration.VariablePrepare
There are at least 3 approaches for replacing variables in
a docx.
1. text replacement on the document surface.
2. using Merge Fields (see org.docx4j.model.fields.merge.MailMerger)
3. binding content controls to an XML Part (via XPath)
Approach 3 is the recommended one when using docx4j. See the
ContentControl* examples, Getting Started, and the subforum.
Approach 1, works in simple cases only.
It won't work if your KEY is split across separate
runs in your docx (which often happens), or if you want
to insert images, or multiple rows in a table.
This class tidies up your document, so your keys should
not be split across separate runs.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidjoinupRuns(P p) static voidprepare(WordprocessingMLPackage wmlPackage) static voidprepare(WordprocessingMLPackage wmlPackage, int flags)
-
Field Details
-
FLAG_NONE
public static final int FLAG_NONE- See Also:
-
FLAG_REMOVE_PROOF_ERRORS
public static final int FLAG_REMOVE_PROOF_ERRORS- See Also:
-
FLAG_REMOVE_CONTENT_CONTROLS
public static final int FLAG_REMOVE_CONTENT_CONTROLS- See Also:
-
FLAG_REMOVE_RSIDS
public static final int FLAG_REMOVE_RSIDS- See Also:
-
FLAG_REMOVE_BOOKMARKS
public static final int FLAG_REMOVE_BOOKMARKS- See Also:
-
-
Constructor Details
-
VariablePrepare
public VariablePrepare()
-
-
Method Details