Package org.docx4j.utils

Examples of org.docx4j.utils.SingleTraversalUtilVisitorCallback


     
      // Can't do it the easy way, so inspect content controls

      TraversalUtilCCVisitor visitor = new TraversalUtilCCVisitor();
      visitor.customXmlParts = wordMLPackage.getCustomXmlDataStorageParts();
      SingleTraversalUtilVisitorCallback ccFinder
      = new SingleTraversalUtilVisitorCallback(visitor);
      ccFinder.walkJAXBElements(
        wordMLPackage.getMainDocumentPart().getJaxbElement().getBody());
      if (visitor.customXmlDataStoragePart==null) {
        log.error("FATAL. Couldn't find CustomXmlDataStoragePart  " );
        return null;
      } else {
View Full Code Here


   
    // Now clean up some more
    org.docx4j.wml.Document wmlDocumentEl = wmlPackage.getMainDocumentPart().getJaxbElement();
    Body body =  wmlDocumentEl.getBody();
           
    SingleTraversalUtilVisitorCallback paragraphVisitor
      = new SingleTraversalUtilVisitorCallback(
          new TraversalUtilParagraphVisitor());
    paragraphVisitor.walkJAXBElements(body);
   
    log.info(XmlUtils.marshaltoString(wmlPackage.getMainDocumentPart().getJaxbElement(), true, true));
  }
View Full Code Here

   */
  public static void visit(WordprocessingMLPackage wmlPackage,
      boolean bodyOnly, TraversalUtilVisitor visitor) {
   
    if (visitor != null) {
      visit(wmlPackage, bodyOnly, new SingleTraversalUtilVisitorCallback(visitor));
    }
  }
View Full Code Here

   * @param visitor
   */
  public static void visit(Object parent, TraversalUtilVisitor visitor) {
   
    if (visitor != null) {
      visit(parent, new SingleTraversalUtilVisitorCallback(visitor));
    }
  }
View Full Code Here

     
    // Change r:embed to r:link
    org.docx4j.wml.Document wmlDocumentEl = (org.docx4j.wml.Document)documentPart.getJaxbElement();
    Body body =  wmlDocumentEl.getBody();
           
    SingleTraversalUtilVisitorCallback imageVisitor
      = new SingleTraversalUtilVisitorCallback(
          new TraversalUtilBlipVisitor());
    imageVisitor.walkJAXBElements(body);
       
       
    // Save it
   
    if (saveResultingDoc) {   
View Full Code Here

TOP

Related Classes of org.docx4j.utils.SingleTraversalUtilVisitorCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.