public class XWPFFootnote extends XWPFAbstractFootnoteEndnote
Create a new footnote using XWPFDocument.createFootnote()
or
XWPFFootnotes.createFootnote()
.
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.
ctFtnEdn, document, footnotes
Constructor and Description |
---|
XWPFFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note,
XWPFAbstractFootnotesEndnotes xFootnotes) |
XWPFFootnote(XWPFDocument document,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn body) |
Modifier and Type | Method and Description |
---|---|
void |
ensureFootnoteRef(XWPFParagraph p)
Ensure that the specified paragraph has a reference marker for this
footnote by adding a footnote reference if one is not found.
|
addNewParagraph, addNewTbl, createParagraph, createTable, createTable, getBodyElements, getCTFtnEdn, getId, getOwner, getParagraph, getParagraphArray, getParagraphs, getPart, getPartType, getPictures, getTable, getTableArray, getTableCell, getTables, getXWPFDocument, init, insertNewParagraph, insertNewTbl, insertTable, iterator, setCTFtnEdn
@Internal public XWPFFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note, XWPFAbstractFootnotesEndnotes xFootnotes)
@Internal public XWPFFootnote(XWPFDocument document, org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn body)
public void ensureFootnoteRef(XWPFParagraph p)
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(XWPFFootnote)
.
The first run of the first paragraph in a footnote should
contain a CTFtnEdnRef
object.
ensureFootnoteRef
in class XWPFAbstractFootnoteEndnote
p
- The XWPFParagraph
to ensureCopyright 2020 The Apache Software Foundation or its licensors, as applicable.