public < T > void runProcessors ( final WordprocessingMLPackage document , final ProxyBuilder < T > proxyBuilder ) { final Map < BigInteger , CommentWrapper > comments = CommentUtil . getComments ( document ) ; CoordinatesWalker walker = new BaseCoordinatesWalker ( document ) { @ Override protected void onParagraph ( ParagraphCoordinates paragraphCoordinates ) { runProcessorsOnParagraphComment ( document , comments , proxyBuilder , paragraphCoordinates ) ; runProcessorsOnInlineContent ( proxyBuilder , paragraphCoordinates ) ; } @ Override protected CommentWrapper onRun ( RunCoordinates runCoordinates , ParagraphCoordinates paragraphCoordinates ) { return runProcessorsOnRunComment ( document , comments , proxyBuilder , runCoordinates , paragraphCoordinates ) ; } } ; walker . walk ( ) ; for ( ICommentProcessor processor : commentProcessors ) { processor . commitChanges ( document ) ; } }
Lets each registered ICommentProcessor have a run on the specified docx document . At the end of the document the commit method is called for each ICommentProcessor . The ICommentProcessors are run in the order they were registered .