Package org.docx4j.model.fields

Examples of org.docx4j.model.fields.ComplexFieldLocator


    FieldsPreprocessor.complexifyFields(pkgOut.getMainDocumentPart() );
    log.debug("complexified: "
        + XmlUtils.marshaltoString(pkgOut.getMainDocumentPart().getJaxbElement(), true));
   
    // find fields
    ComplexFieldLocator fl = new ComplexFieldLocator();
    new TraversalUtil(pkgOut.getMainDocumentPart().getContent(), fl);
    log.info("Found " + fl.getStarts().size() + " fields ");
   
   
    // canonicalise and setup fieldRefs
    List<FieldRef> fieldRefs = new ArrayList<FieldRef>();
    for( P p : fl.getStarts() ) {
      int index = ((ContentAccessor)p.getParent()).getContent().indexOf(p);
      P newP = FieldsPreprocessor.canonicalise(p, fieldRefs);
      ((ContentAccessor)p.getParent()).getContent().set(index, newP);
     
      /*
 
View Full Code Here


        Body shell = Context.getWmlObjectFactory().createBody();
        shell.getContent().addAll(contentList);
        Body shellClone = (Body) XmlUtils.deepCopy(shell);

        // find fields
        ComplexFieldLocator fl = new ComplexFieldLocator();
        new TraversalUtil(shellClone, fl);
        log.info("Found " + fl.getStarts().size() + " fields ");

        // canonicalise and setup fieldRefs
        List<FieldRef> fieldRefs = new ArrayList<FieldRef>();
    canonicaliseStarts(fl, fieldRefs);
View Full Code Here

    Body shell = Context.getWmlObjectFactory().createBody();
    shell.getContent().addAll(contentList);
    Body shellClone = (Body)XmlUtils.deepCopy(shell);
   
    // find fields
    ComplexFieldLocator fl = new ComplexFieldLocator();
    new TraversalUtil(shellClone, fl);
    log.info("Found " + fl.getStarts().size() + " fields ");
   
   
    // canonicalise and setup fieldRefs
    List<FieldRef> fieldRefs = new ArrayList<FieldRef>();
    canonicaliseStarts(fl, fieldRefs);
View Full Code Here

  }

  private static void listFieldsInPart(String partName, List<Object> contentList, StringBuilder sb) throws Docx4JException {

    // find fields
    ComplexFieldLocator fl = new ComplexFieldLocator();
    new TraversalUtil(contentList, fl);
   
    if (fl.getStarts().size()==0) {
      sb.append("\n\n" + partName + ": no fields detected.");
      return;
    }

    sb.append("\n\n" + partName + ": " + fl.getStarts().size() + " paragraphs containing the following fields: ");

    // canonicalise and setup fieldRefs
    List<FieldRef> fieldRefs = new ArrayList<FieldRef>();
    for( P p : fl.getStarts() ) {
      FieldsPreprocessor.canonicalise(p, fieldRefs);
    }

    // Populate
    for (FieldRef fr : fieldRefs) {
View Full Code Here

TOP

Related Classes of org.docx4j.model.fields.ComplexFieldLocator

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.