Class XWPFEndnote
- All Implemented Interfaces:
Iterable<XWPFParagraph>,IBody
End notes are collected at the end of a document or section rather than at the bottom of a page.
Create a new footnote using XWPFDocument.createEndnote() or
XWPFEndnotes.createEndnote().
The first body element of a footnote should (or possibly must) be a paragraph
with the first run containing a CTFtnEdnRef object. The XWPFAbstractFootnoteEndnote.createParagraph()
and XWPFAbstractFootnoteEndnote.createTable() methods do this for you.
Footnotes have IDs that are unique across all footnotes in the document. You use the footnote ID to create a reference to a footnote from within a paragraph.
To create a reference to a footnote within a paragraph you create a run
with a CTFtnEdnRef that specifies the ID of the target paragraph.
The XWPFParagraph.addFootnoteReference(XWPFAbstractFootnoteEndnote)
method does this for you.
- Since:
- 4.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionXWPFEndnote(XWPFDocument document, CTFtnEdn body) XWPFEndnote(CTFtnEdn note, XWPFAbstractFootnotesEndnotes footnotes) -
Method Summary
Modifier and TypeMethodDescriptionvoidEnsure that the specified paragraph has a reference marker for this end note by adding a footnote reference if one is not found.Methods inherited from class org.apache.poi.xwpf.usermodel.XWPFAbstractFootnoteEndnote
addNewParagraph, addNewTbl, createParagraph, createTable, createTable, getBodyElements, getCTFtnEdn, getId, getOwner, getParagraph, getParagraphArray, getParagraphs, getPart, getPartType, getPictures, getTable, getTableArray, getTableCell, getTables, getXWPFDocument, insertNewParagraph, insertNewTbl, insertTable, iterator, setCTFtnEdn, spliterator
-
Constructor Details
-
XWPFEndnote
public XWPFEndnote() -
XWPFEndnote
-
XWPFEndnote
-
-
Method Details
-
ensureFootnoteRef
Ensure that the specified paragraph has a reference marker for this end note by adding a footnote reference if one is not found.This method is for the first paragraph in the footnote, not paragraphs that will refer to the footnote. For references to the footnote, use
XWPFParagraph.addFootnoteReference(XWPFAbstractFootnoteEndnote).The first run of the first paragraph in a footnote should contain a
CTFtnEdnRefobject.- Specified by:
ensureFootnoteRefin classXWPFAbstractFootnoteEndnote- Parameters:
p- TheXWPFParagraphto ensure- Since:
- 4.0.0
-