Class XWPFEndnotes

    • Field Detail

      • ctEndnotes

        protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEndnotes ctEndnotes
    • Constructor Detail

      • XWPFEndnotes

        public XWPFEndnotes()
      • XWPFEndnotes

        public XWPFEndnotes​(PackagePart part)
        Construct XWPFEndnotes from a package part
        Parameters:
        part - the package part holding the data of the footnotes,
        Since:
        POI 3.14-Beta1
    • Method Detail

      • setEndnotes

        @Internal
        public void setEndnotes​(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEndnotes endnotes)
        Set the end notes for this part.
        Parameters:
        endnotes - The endnotes to be added.
      • createEndnote

        public XWPFEndnote createEndnote()
        Create a new end note and add it to the document.
        Returns:
        New XWPFEndnote
        Since:
        4.0.0
      • removeFootnote

        public boolean removeFootnote​(int pos)
        Remove the specified footnote if present.
        Returns:
        True if the footnote was removed.
        Since:
        4.0.0
      • commit

        protected void commit()
                       throws IOException
        Description copied from class: POIXMLDocumentPart
        Save the content in the underlying package part. Default implementation is empty meaning that the package part is left unmodified.

        Sub-classes should override and add logic to marshal the "model" into Ooxml4J.

        For example, the code saving a generic XML entry may look as follows:

         protected void commit() throws IOException {
           PackagePart part = getPackagePart();
           try (OutputStream out = part.getOutputStream()) {
             XmlObject bean = getXmlBean(); //the "model" which holds changes in memory
             bean.save(out, DEFAULT_XML_OPTIONS);
           }
         }
         
        Overrides:
        commit in class POIXMLDocumentPart
        Throws:
        IOException - a subclass may throw an IOException if the changes can't be committed
      • addEndnote

        @Internal
        public XWPFEndnote addEndnote​(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
        Add an endnote to the document
        Parameters:
        note - Note to add
        Returns:
        New XWPFEndnote
      • getEndnotesList

        public List<XWPFEndnote> getEndnotesList()
        Get the list of XWPFEndnote in the Endnotes part.
        Returns:
        List, possibly empty, of end notes.
      • removeEndnote

        public boolean removeEndnote​(int pos)
        Remove the specified end note if present.
        Parameters:
        pos - Array position of the endnote to be removed
        Returns:
        True if the end note was removed.
        Since:
        4.0.0