/** * Convenience method to getBody().getContent() * @since 2.7 */ public List<Object> getContent() { return getBody().getContent(); }
/** * Convenience method to getJaxbElement().getBody().getContent() * @since 2.7 */ public List<Object> getContent() { if (this.getJaxbElement()==null) { this.setJaxbElement( Context.getWmlObjectFactory().createDocument() ); } if (this.getJaxbElement().getBody()==null) { this.getJaxbElement().setBody( Context.getWmlObjectFactory().createBody() ); } return this.getJaxbElement().getContent(); }
/** * Create an instance of {@link Document } * */ public Document createDocument() { return new Document(); }
mdp.getJaxbElement().setBody(transitionContainer.getBody());
@Override public String getMceIgnorable() { return this.getJaxbElement().getIgnorable(); }
/** * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. * * @param parent * The parent object in the object tree. * @param unmarshaller * The unmarshaller that generated the instance. */ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { setParent(parent); }
new TraversalUtil(document.getContent(), sbr); for( int i=sbr.sdtBlocks.size()-1 ; i>=0; i--) {
org.docx4j.wml.Document wmlDocumentEl = factory.createDocument(); wmlDocumentEl.setBody(body);
/** * Knows how to setMcIgnorable on wml.Document only. * * @param prefixMapper * @param o * @since 3.1.1 */ private static String setMcIgnorable(McIgnorableNamespaceDeclarator prefixMapper, Object o) { if (o instanceof org.docx4j.wml.Document) { String ignorables = ((org.docx4j.wml.Document)o).getIgnorable(); if (ignorables!=null) { prefixMapper.setMcIgnorable(ignorables); // TODO, add getMcChoiceNamespaces() } return ignorables; } return null; }
/** * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. * * @param parent * The parent object in the object tree. * @param unmarshaller * The unmarshaller that generated the instance. */ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { setParent(parent); }
new TraversalUtil(document.getContent(), sbr); for( int i=sbr.sdtBlocks.size()-1 ; i>=0; i--) {
/** * Convenience method to getJaxbElement().getBody().getContent() * @since 2.7 */ public List<Object> getContent() { if (this.getJaxbElement()==null) { this.setJaxbElement( Context.getWmlObjectFactory().createDocument() ); } if (this.getJaxbElement().getBody()==null) { this.getJaxbElement().setBody( Context.getWmlObjectFactory().createBody() ); } return this.getJaxbElement().getContent(); }
org.docx4j.wml.Document wmlDocumentEl = factory.createDocument(); wmlDocumentEl.setBody(body); wordDocumentPart.setJaxbElement(wmlDocumentEl); wmlPack.addTargetPart(wordDocumentPart);
@Override protected void setMceIgnorable(McIgnorableNamespaceDeclarator namespacePrefixMapper) { // NB it is up to you to jaxbElement.setIgnorable; see further McIgnorableNamespaceDeclarator // MainDocumentPartMceIgnorableHelper helper = new MainDocumentPartMceIgnorableHelper(); // this.jaxbElement.setIgnorable( // helper.getMceIgnorable(this.getJaxbElement().getBody())); namespacePrefixMapper.setMcIgnorable( this.getJaxbElement().getIgnorable() ); }
/** * Create an instance of {@link Document } * */ public Document createDocument() { return new Document(); }
/** The dummy section wrappers only contains one section with all the document. Therefore * any sections within the document are ignored in the conversion process. As it doesn't * need to check for sections it is faster and the html-Output only uses one section.<br> * It will use the Header/Footer of the body sectPr. This isn't correct, if there are * several Sections in the document, but to find the correct SectPr it would need to check * the document content - and the aim of this method is a low overhead. * * @param wmlPackage * @param dummyPageNumbering * @return */ protected static List<ConversionSectionWrapper> processDummy(WordprocessingMLPackage wmlPackage, Document document, RelationshipsPart rels, BooleanDefaultTrue evenAndOddHeaders, boolean dummyPageNumbering) { log.debug("starting"); List<ConversionSectionWrapper> conversionSections = new ArrayList<ConversionSectionWrapper>(); ConversionSectionWrapper currentSectionWrapper = null; HeaderFooterPolicy previousHF = new HeaderFooterPolicy(document.getBody().getSectPr(), null, rels, evenAndOddHeaders); // SectionWrapper does work where sectPr is null (ie document has no body level sectPr), // so document.getBody().getSectPr() is ok currentSectionWrapper = createSectionWrapper( document.getBody().getSectPr(), previousHF, rels, evenAndOddHeaders, 1, document.getBody().getContent(), dummyPageNumbering); conversionSections.add(currentSectionWrapper); return conversionSections; }
mdp.getJaxbElement().setBody(transitionContainer.getBody());
@Override public String getMceIgnorable() { return this.getJaxbElement().getIgnorable(); }
/** * If the first w:p starts with a w:sectPr, this is moved into a * new following w:p. This prevents the creation of an empty fo:flow, * which causes a validation exception in FOP. */ public static void process(WordprocessingMLPackage wmlPackage) { Body body = wmlPackage.getMainDocumentPart().getJaxbElement().getBody(); moveSectPr(body); }