Package org.apache.poi.xwpf.usermodel
Class XWPFEndnotes
- java.lang.Object
-
- org.apache.poi.ooxml.POIXMLDocumentPart
-
- org.apache.poi.xwpf.usermodel.XWPFAbstractFootnotesEndnotes
-
- org.apache.poi.xwpf.usermodel.XWPFEndnotes
-
public class XWPFEndnotes extends XWPFAbstractFootnotesEndnotes
Looks after the collection of end notes for a document. Managed end notes (XWPFEndnote
).- Since:
- 4.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
-
-
Constructor Summary
Constructors Constructor Description XWPFEndnotes()
XWPFEndnotes(PackagePart part)
Construct XWPFEndnotes from a package part
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEndnote(XWPFEndnote endnote)
add anXWPFEndnote
to the documentXWPFEndnote
addEndnote(CTFtnEdn note)
Add an endnote to the documentXWPFEndnote
createEndnote()
Create a new end note and add it to the document.java.util.List<XWPFEndnote>
getEndnotesList()
Get the list ofXWPFEndnote
in the Endnotes part.XWPFEndnote
getFootnoteById(int id)
Get the end note with the specified ID, if any.boolean
removeEndnote(int pos)
Remove the specified end note if present.boolean
removeFootnote(int pos)
Remove the specified footnote if present.void
setEndnotes(CTEndnotes endnotes)
Set the end notes for this part.-
Methods inherited from class org.apache.poi.xwpf.usermodel.XWPFAbstractFootnotesEndnotes
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
-
XWPFEndnotes
public XWPFEndnotes()
-
XWPFEndnotes
public XWPFEndnotes(PackagePart part) throws java.io.IOException, OpenXML4JException
Construct XWPFEndnotes 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
-
-
Method Detail
-
setEndnotes
@Internal public void setEndnotes(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.- Parameters:
pos
-- Returns:
- True if the footnote was removed.
- Since:
- 4.0.0
-
addEndnote
public void addEndnote(XWPFEndnote endnote)
add anXWPFEndnote
to the document- Parameters:
endnote
-- Throws:
java.io.IOException
-
addEndnote
@Internal public XWPFEndnote addEndnote(CTFtnEdn note)
Add an endnote to the document- Parameters:
note
- Note to add- Returns:
- New
XWPFEndnote
- Throws:
java.io.IOException
-
getFootnoteById
public XWPFEndnote getFootnoteById(int id)
Get the end note with the specified ID, if any.- Overrides:
getFootnoteById
in classXWPFAbstractFootnotesEndnotes
- Parameters:
id
- End note ID.- Returns:
- The end note or null if not found.
-
getEndnotesList
public java.util.List<XWPFEndnote> getEndnotesList()
Get the list ofXWPFEndnote
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
-
-