Class RepeatProcessor
java.lang.Object
org.wickedsource.docxstamper.processor.BaseCommentProcessor
org.wickedsource.docxstamper.processor.repeat.RepeatProcessor
- All Implemented Interfaces:
ICommentProcessor,IRepeatProcessor
Repeats a table row for each element in a list.
- Version:
- ${version}
- Author:
- Joseph Verron
-
Field Summary
Fields inherited from class org.wickedsource.docxstamper.processor.BaseCommentProcessor
placeholderReplacer -
Method Summary
Modifier and TypeMethodDescriptionvoidcommitChanges(org.docx4j.openpackaging.packages.WordprocessingMLPackage document) This method is called after all comments in the .docx template have been passed to the comment processor.static ICommentProcessorCreates a new RepeatProcessor.static ICommentProcessorCreates a new RepeatProcessor.voidrepeatTableRow(List<Object> objects) May be called to mark a table row to be copied once for each element in the passed-in list.voidreset()Resets all state in the comment processor so that it can be re-used in another stamping process.static List<org.docx4j.wml.Tr> stampEmptyContext(PlaceholderReplacer pr, org.docx4j.openpackaging.packages.WordprocessingMLPackage document, org.docx4j.wml.Tr row1) Creates a new RepeatProcessor.Methods inherited from class org.wickedsource.docxstamper.processor.BaseCommentProcessor
getCurrentCommentWrapper, getCurrentRun, getDocument, getParagraph, setCurrentCommentWrapper, setCurrentRun, setDocument, setParagraph
-
Method Details
-
newInstanceWithNullReplacement
Creates a new RepeatProcessor.- Parameters:
pr- The PlaceholderReplacer to use.- Returns:
- A new RepeatProcessor.
-
stampEmptyContext
public static List<org.docx4j.wml.Tr> stampEmptyContext(PlaceholderReplacer pr, org.docx4j.openpackaging.packages.WordprocessingMLPackage document, org.docx4j.wml.Tr row1) Creates a new RepeatProcessor.- Parameters:
pr- The PlaceholderReplacer to use.document- aWordprocessingMLPackageobjectrow1- aTrobject- Returns:
- A new RepeatProcessor.
-
newInstance
Creates a new RepeatProcessor.- Parameters:
pr- The PlaceholderReplacer to use.- Returns:
- A new RepeatProcessor.
-
commitChanges
public void commitChanges(org.docx4j.openpackaging.packages.WordprocessingMLPackage document) This method is called after all comments in the .docx template have been passed to the comment processor. All manipulations of the .docx document SHOULD BE done in this method. If certain manipulations are already done within in the custom methods of a comment processor, the ongoing iteration over the paragraphs in the document may be disturbed.- Specified by:
commitChangesin interfaceICommentProcessor- Parameters:
document- The Word document that can be manipulated by using the DOCX4J api.
-
reset
public void reset()Resets all state in the comment processor so that it can be re-used in another stamping process.- Specified by:
resetin interfaceICommentProcessor
-
repeatTableRow
May be called to mark a table row to be copied once for each element in the passed-in list. Within each copy of the row, all expressions are evaluated against one of the objects in the list.- Specified by:
repeatTableRowin interfaceIRepeatProcessor- Parameters:
objects- the objects which serve as context root for expressions found in the template table row.
-