Package org.docx4j

Examples of org.docx4j.TraversalUtil


   
    MainDocumentPart mdp = wordMLPackage.getMainDocumentPart();
   
    // Remove from sectPr
    SectPrFinder finder = new SectPrFinder(mdp);
      new TraversalUtil(mdp.getContent(), finder);
      for (SectPr sectPr : finder.getSectPrList()) {
        sectPr.getEGHdrFtrReferences().clear();
      }
     
      // Remove rels
View Full Code Here


  protected void generateBodyContent(CC conversionContext, Document document,
      List<Object> content, Element currentParent) throws Docx4JException {
  AbstractVisitorExporterGenerator<CC> generator =
      generatorFactory.createInstance(conversionContext, document, currentParent);
    new TraversalUtil(content, generator);
  }
View Full Code Here

        protected void collectDataFromObjects(Object... objects) {
            for (Object object : objects) {
                if (object != null) {
                    TextVisitor collectAliasesCallback = new TextVisitor();
                    new TraversalUtil(object, collectAliasesCallback);
                    texts.addAll(collectAliasesCallback.textWrappers);
                }
            }
        }
View Full Code Here

            }
        }

        void collectData() {
            TableCollector collectTablesCallback = new TableCollector();
            new TraversalUtil(mainDocumentPart, collectTablesCallback);
            TextVisitor collectAliasesCallback = new TextVisitor();
            new TraversalUtil(mainDocumentPart, collectAliasesCallback);
            tables = collectTablesCallback.tableManagers;
            texts = collectAliasesCallback.textWrappers;

            //collect data from headers
            List<SectionWrapper> sectionWrappers = wordprocessingMLPackage.getDocumentModel().getSections();
View Full Code Here

            table.getContent().add(index, copiedRow);
            return copiedRow;
        }

        public void fillRowFromBand(Tr row, final BandData band) {
            new TraversalUtil(row, new AliasVisitor() {
                @Override
                protected void handle(Text text) {
                    String sourceString = text.getValue();
                    String resultString = insertBandDataToString(band, sourceString);
                    text.setValue(resultString);
View Full Code Here

                    }
                }

                if (currentTable.rowWithAliases == null) {
                    RegexpFinder aliasFinder = new RegexpFinder<P>(UNIVERSAL_ALIAS_PATTERN, P.class);
                    new TraversalUtil(currentRow, aliasFinder);

                    if (aliasFinder.getValue() != null) {
                        currentTable.rowWithAliases = currentRow;
                    }
                }
View Full Code Here

            return null;
        }

        protected void findNameForCurrentTable(final TableManager currentTable) {
            new TraversalUtil(currentTable.firstRow,
                    new RegexpFinder<P>(BAND_NAME_DECLARATION_PATTERN, P.class) {
                        @Override
                        protected void onFind(P paragraph, Matcher matcher) {
                            super.onFind(paragraph, matcher);
                            currentTable.bandName = matcher.group(1);
View Full Code Here

        }
        return null;
    }

    public List<T> getResult() {
        new TraversalUtil(parent, this);
        return this.result;
    }
View Full Code Here

        }
        return null;
    }

    public T getResult() {
        new TraversalUtil(parent, this);
        return this.result;
    }
View Full Code Here

        MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();

        org.docx4j.wml.Document wmlDocumentEl = (org.docx4j.wml.Document) documentPart.getJaxbElement();
        Body body = wmlDocumentEl.getBody();

        new TraversalUtil(body,

            new Callback() {
   
                String indent = "";
   
View Full Code Here

TOP

Related Classes of org.docx4j.TraversalUtil

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.