Class DocumentWalker
java.lang.Object
org.wickedsource.docxstamper.util.walk.DocumentWalker
- Direct Known Subclasses:
BaseDocumentWalker
This class walks the document and calls abstract methods for each element it encounters.
The following elements are supported:
PRTblTrTcCommentRangeStartCommentRangeEndR.CommentReference
SdtBlockSdtRunSdtElementCTSimpleFieldCTSdtCellCTSdtContentCell
- Version:
- 1.6.6
- Author:
- Joseph Verron
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDocumentWalker(org.docx4j.wml.ContentAccessor contentAccessor) Creates a new DocumentWalker that will traverse the given document. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidonCommentRangeEnd(org.docx4j.wml.CommentRangeEnd commentRangeEnd) This method is called for everyCommentRangeEndelement in the document.protected abstract voidonCommentRangeStart(org.docx4j.wml.CommentRangeStart commentRangeStart) This method is called for everyCommentRangeStartelement in the document.protected abstract voidonCommentReference(org.docx4j.wml.R.CommentReference commentReference) This method is called for everyR.CommentReferenceelement in the document.protected abstract voidonParagraph(org.docx4j.wml.P paragraph) This method is called for everyPelement in the document.protected abstract voidonRun(org.docx4j.wml.R run) This method is called for everyRelement in the document.protected abstract voidonTable(org.docx4j.wml.Tbl table) This method is called for everyTblelement in the document.protected abstract voidonTableCell(org.docx4j.wml.Tc tableCell) This method is called for everyTcelement in the document.protected abstract voidonTableRow(org.docx4j.wml.Tr tableRow) This method is called for everyTrelement in the document.voidwalk()Starts the traversal of the document.
-
Constructor Details
-
DocumentWalker
protected DocumentWalker(org.docx4j.wml.ContentAccessor contentAccessor) Creates a new DocumentWalker that will traverse the given document.- Parameters:
contentAccessor- the document to traverse.
-
-
Method Details
-
walk
public void walk()Starts the traversal of the document. -
onRun
protected abstract void onRun(org.docx4j.wml.R run) This method is called for everyRelement in the document.- Parameters:
run- theRelement to process.
-
onParagraph
protected abstract void onParagraph(org.docx4j.wml.P paragraph) This method is called for everyPelement in the document.- Parameters:
paragraph- thePelement to process.
-
onTable
protected abstract void onTable(org.docx4j.wml.Tbl table) This method is called for everyTblelement in the document.- Parameters:
table- theTblelement to process.
-
onTableCell
protected abstract void onTableCell(org.docx4j.wml.Tc tableCell) This method is called for everyTcelement in the document.- Parameters:
tableCell- theTcelement to process.
-
onTableRow
protected abstract void onTableRow(org.docx4j.wml.Tr tableRow) This method is called for everyTrelement in the document.- Parameters:
tableRow- theTrelement to process.
-
onCommentRangeStart
protected abstract void onCommentRangeStart(org.docx4j.wml.CommentRangeStart commentRangeStart) This method is called for everyCommentRangeStartelement in the document.- Parameters:
commentRangeStart- theCommentRangeStartelement to process.
-
onCommentRangeEnd
protected abstract void onCommentRangeEnd(org.docx4j.wml.CommentRangeEnd commentRangeEnd) This method is called for everyCommentRangeEndelement in the document.- Parameters:
commentRangeEnd- theCommentRangeEndelement to process.
-
onCommentReference
protected abstract void onCommentReference(org.docx4j.wml.R.CommentReference commentReference) This method is called for everyR.CommentReferenceelement in the document.- Parameters:
commentReference- theR.CommentReferenceelement to process.
-