public abstract class XWPFAbstractFootnoteEndnote extends java.lang.Object implements java.lang.Iterable<XWPFParagraph>, IBody
XWPFFootnote
and end
notes XWPFEndnote
).
The only significant difference between footnotes and
end notes is which part they go on. Footnotes are managed by the Footnotes part
XWPFFootnotes
and end notes are managed by the Endnotes part XWPFEndnotes
.
Modifier and Type | Field and Description |
---|---|
protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn |
ctFtnEdn |
protected XWPFDocument |
document |
protected XWPFAbstractFootnotesEndnotes |
footnotes |
Modifier | Constructor and Description |
---|---|
|
XWPFAbstractFootnoteEndnote() |
protected |
XWPFAbstractFootnoteEndnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note,
XWPFAbstractFootnotesEndnotes footnotes) |
protected |
XWPFAbstractFootnoteEndnote(XWPFDocument document,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn body) |
Modifier and Type | Method and Description |
---|---|
XWPFParagraph |
addNewParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph)
Add a new
XWPFParagraph to the end of the footnote. |
XWPFTable |
addNewTbl(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table)
Add a new
XWPFTable to the end of the footnote. |
XWPFParagraph |
createParagraph()
Appends a new
XWPFParagraph to this footnote. |
XWPFTable |
createTable()
Appends a new
XWPFTable to this footnote |
XWPFTable |
createTable(int rows,
int cols)
Appends a new
XWPFTable to this footnote |
abstract 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.
|
java.util.List<IBodyElement> |
getBodyElements()
Gets the body elements (
IBodyElement ) of the footnote. |
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn |
getCTFtnEdn()
Gets the underlying CTFtnEdn object for the footnote.
|
java.math.BigInteger |
getId()
Get the ID of the footnote.
|
POIXMLDocumentPart |
getOwner()
The owning object for this footnote
|
XWPFParagraph |
getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
Returns the paragraph corresponding to the provided
CTP . |
XWPFParagraph |
getParagraphArray(int pos)
Returns the
XWPFParagraph at position pos in footnote's paragraph array. |
java.util.List<XWPFParagraph> |
getParagraphs()
Get the list of
XWPFParagraph s in the footnote. |
POIXMLDocumentPart |
getPart()
Get the Part to which the footnote belongs, which you need for adding relationships to other parts
|
BodyType |
getPartType()
Get the part type
BodyType of the footnote. |
java.util.List<XWPFPictureData> |
getPictures()
Gets the list of
XWPFPictureData s in the footnote. |
XWPFTable |
getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTable)
|
XWPFTable |
getTableArray(int pos)
Gets the
XWPFTable at the specified position from the footnote's table array. |
XWPFTableCell |
getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
get the
XWPFTableCell that belongs to the CTTc cell. |
java.util.List<XWPFTable> |
getTables()
Get the list of
XWPFTable s in the footnote. |
XWPFDocument |
getXWPFDocument()
Get the
XWPFDocument the footnote is part of. |
protected void |
init() |
XWPFParagraph |
insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
Add a new
XWPFParagraph at position of the cursor. |
XWPFTable |
insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
Insert a table constructed from OOXML table markup.
|
void |
insertTable(int pos,
XWPFTable table)
Inserts an existing {@link XWPFTable) into the arrays bodyElements and tables.
|
java.util.Iterator<XWPFParagraph> |
iterator()
Get an iterator over the
XWPFParagraph s in the footnote. |
void |
setCTFtnEdn(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn footnote)
Set the underlying CTFtnEdn for the footnote.
|
protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn ctFtnEdn
protected XWPFAbstractFootnotesEndnotes footnotes
protected XWPFDocument document
public XWPFAbstractFootnoteEndnote()
@Internal protected XWPFAbstractFootnoteEndnote(XWPFDocument document, org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn body)
@Internal protected XWPFAbstractFootnoteEndnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note, XWPFAbstractFootnotesEndnotes footnotes)
protected void init()
public java.util.List<XWPFParagraph> getParagraphs()
XWPFParagraph
s in the footnote.getParagraphs
in interface IBody
public java.util.Iterator<XWPFParagraph> iterator()
XWPFParagraph
s in the footnote.iterator
in interface java.lang.Iterable<XWPFParagraph>
public java.util.List<XWPFPictureData> getPictures()
XWPFPictureData
s in the footnote.public java.util.List<IBodyElement> getBodyElements()
IBodyElement
) of the footnote.getBodyElements
in interface IBody
public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn getCTFtnEdn()
public void setCTFtnEdn(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn footnote)
Use XWPFDocument.createFootnote()
to create new footnotes.
footnote
- The CTFtnEdn object that will underly the footnote.public XWPFTable getTableArray(int pos)
XWPFTable
at the specified position from the footnote's table array.getTableArray
in interface IBody
pos
- in table arrayXWPFTable
at position pos, or null if there is no table at position pos.IBody.getTableArray(int)
public void insertTable(int pos, XWPFTable table)
insertTable
in interface IBody
pos
- Position, in the bodyElements array, to insert the tabletable
- {@link XWPFTable) to be insertedIBody.insertTable(int pos, XWPFTable table)
public XWPFTable getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTable)
XWPFTable
of the parameter
ctTable in the tableList of this header
the method will return this table, or null if there is no
corresponding XWPFTable
.getTable
in interface IBody
ctTable
- IBody.getTable(CTTbl ctTable)
public XWPFParagraph getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
IBody
CTP
.getParagraph
in interface IBody
p
- is instance of CTP and is searching for an XWPFParagraphCTP
, or null
if there is no corresponding paragraph in
this body.public XWPFParagraph getParagraphArray(int pos)
XWPFParagraph
at position pos in footnote's paragraph array.getParagraphArray
in interface IBody
pos
- Array position of the paragraph to get.XWPFParagraph
at position pos, or null if there is no paragraph at that position.IBody.getParagraphArray(int pos)
public XWPFTableCell getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
XWPFTableCell
that belongs to the CTTc cell.getTableCell
in interface IBody
cell
- XWPFTableCell
that corresponds to the CTTc cell, if there is one, otherwise null.IBody.getTableCell(CTTc cell)
public POIXMLDocumentPart getOwner()
XWPFFootnotes
object that contains this footnote.public XWPFTable insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
insertNewTbl
in interface IBody
cursor
- XWPFTable
IBody.insertNewTbl(XmlCursor cursor)
public XWPFParagraph insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
XWPFParagraph
at position of the cursor.insertNewParagraph
in interface IBody
cursor
- XWPFParagraph
IBody.insertNewParagraph(XmlCursor cursor)
public XWPFTable addNewTbl(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table)
XWPFTable
to the end of the footnote.public XWPFParagraph addNewParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph)
XWPFParagraph
to the end of the footnote.paragraph
- CTP paragraph from which to construct the XWPFParagraph
XWPFParagraph
public XWPFDocument getXWPFDocument()
XWPFDocument
the footnote is part of.getXWPFDocument
in interface IBody
IBody.getXWPFDocument()
public POIXMLDocumentPart getPart()
getPart
in interface IBody
POIXMLDocumentPart
that contains the footnote.IBody.getPart()
public BodyType getPartType()
BodyType
of the footnote.getPartType
in interface IBody
BodyType
value.IBody.getPartType()
public java.math.BigInteger getId()
Footnote IDs are unique across all bottom-of-the-page and end note footnotes.
public XWPFParagraph createParagraph()
XWPFParagraph
to this footnote.XWPFParagraph
public abstract 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.
p
- The XWPFParagraph
to ensurepublic XWPFTable createTable()
XWPFTable
to this footnoteXWPFTable
public XWPFTable createTable(int rows, int cols)
XWPFTable
to this footnoterows
- Number of rows to initialize the table withcols
- Number of columns to initialize the table withXWPFTable
with the specified number of rows and columnsCopyright 2021 The Apache Software Foundation or its licensors, as applicable.