Package org.apache.poi.xwpf.usermodel
Class XWPFFootnotes
- java.lang.Object
-
- org.apache.poi.ooxml.POIXMLDocumentPart
-
- org.apache.poi.xwpf.usermodel.XWPFAbstractFootnotesEndnotes
-
- org.apache.poi.xwpf.usermodel.XWPFFootnotes
-
public class XWPFFootnotes extends XWPFAbstractFootnotesEndnotes
Looks after the collection of Footnotes for a document. Manages bottom-of-the-page footnotes (XWPFFootnote
).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
-
-
Constructor Summary
Constructors Constructor Description XWPFFootnotes()
Construct XWPFFootnotes from scratch for a new document.XWPFFootnotes(PackagePart part)
Construct XWPFFootnotes from a package part
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFootnote(XWPFFootnote footnote)
Add anXWPFFootnote
to the documentXWPFFootnote
addFootnote(CTFtnEdn note)
Add a CT footnote to the documentXWPFFootnote
createFootnote()
Create a new footnote and add it to the document.java.util.List<XWPFFootnote>
getFootnotesList()
Get the list ofXWPFFootnote
in the Footnotes part.boolean
removeFootnote(int pos)
Remove the specified footnote if present.void
setFootnotes(CTFootnotes footnotes)
Sets the ctFootnotes-
Methods inherited from class org.apache.poi.xwpf.usermodel.XWPFAbstractFootnotesEndnotes
getFootnoteById, getIdManager, getXWPFDocument, setIdManager, setXWPFDocument
-
Methods inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, isCommited, setCommited, toString
-
-
-
-
Constructor Detail
-
XWPFFootnotes
public XWPFFootnotes(PackagePart part) throws java.io.IOException, OpenXML4JException
Construct XWPFFootnotes from a package part- Parameters:
part
- the package part holding the data of the footnotes,- Throws:
java.io.IOException
OpenXML4JException
- Since:
- POI 3.14-Beta1
-
XWPFFootnotes
public XWPFFootnotes()
Construct XWPFFootnotes from scratch for a new document.
-
-
Method Detail
-
setFootnotes
@Internal public void setFootnotes(CTFootnotes footnotes)
Sets the ctFootnotes- Parameters:
footnotes
- Collection of CTFntEdn objects.
-
createFootnote
public XWPFFootnote createFootnote()
Create a new footnote and add it to the document.- Returns:
- New
XWPFFootnote
- Since:
- 4.0.0
-
removeFootnote
public boolean removeFootnote(int pos)
Remove the specified footnote if present.- Parameters:
pos
- Array position of the footnote to be removed- Returns:
- True if the footnote was removed.
- Since:
- 4.0.0
-
addFootnote
public void addFootnote(XWPFFootnote footnote)
Add anXWPFFootnote
to the document- Parameters:
footnote
- Footnote to add- Throws:
java.io.IOException
-
addFootnote
@Internal public XWPFFootnote addFootnote(CTFtnEdn note)
Add a CT footnote to the document- Parameters:
note
- CTFtnEdn to add.- Throws:
java.io.IOException
-
getFootnotesList
public java.util.List<XWPFFootnote> getFootnotesList()
Get the list ofXWPFFootnote
in the Footnotes part.- Returns:
- List, possibly empty, of footnotes.
-
-