public class XWPFFootnotes extends XWPFAbstractFootnotesEndnotes
XWPFFootnote
).POIXMLDocumentPart.RelationPart
Modifier and Type | Field and Description |
---|---|
protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes |
ctFootnotes |
document, listFootnote
Constructor and Description |
---|
XWPFFootnotes()
Construct XWPFFootnotes from scratch for a new document.
|
XWPFFootnotes(PackagePart part)
Construct XWPFFootnotes from a package part
|
Modifier and Type | Method and Description |
---|---|
XWPFFootnote |
addFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
Add a CT footnote to the document
|
void |
addFootnote(XWPFFootnote footnote)
Add an
XWPFFootnote to the document |
protected void |
commit()
Save the content in the underlying package part.
|
XWPFFootnote |
createFootnote()
Create a new footnote and add it to the document.
|
java.util.List<XWPFFootnote> |
getFootnotesList()
Get the list of
XWPFFootnote in the Footnotes part. |
protected void |
onDocumentRead()
Read document
|
boolean |
removeFootnote(int pos)
Remove the specified footnote if present.
|
void |
setFootnotes(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes footnotes)
Sets the ctFootnotes
|
getFootnoteById, getIdManager, getXWPFDocument, setIdManager, setXWPFDocument
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toString
protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes ctFootnotes
public XWPFFootnotes(PackagePart part)
part
- the package part holding the data of the footnotes,public XWPFFootnotes()
@Internal public void setFootnotes(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes footnotes)
footnotes
- Collection of CTFntEdn objects.public XWPFFootnote createFootnote()
XWPFFootnote
public boolean removeFootnote(int pos)
pos
- Array position of the footnote to be removedprotected void onDocumentRead() throws java.io.IOException
onDocumentRead
in class POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException when a document is readprotected void commit() throws java.io.IOException
POIXMLDocumentPart
Sub-classes should override and add logic to marshal the "model" into Ooxml4J.
For example, the code saving a generic XML entry may look as follows:
protected void commit() throws IOException { PackagePart part = getPackagePart(); OutputStream out = part.getOutputStream(); XmlObject bean = getXmlBean(); //the "model" which holds changes in memory bean.save(out, DEFAULT_XML_OPTIONS); out.close(); }
commit
in class POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException if the changes can't be committedpublic void addFootnote(XWPFFootnote footnote)
XWPFFootnote
to the documentfootnote
- Footnote to addjava.io.IOException
@Internal public XWPFFootnote addFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
note
- CTFtnEdn to add.java.io.IOException
public java.util.List<XWPFFootnote> getFootnotesList()
XWPFFootnote
in the Footnotes part.Copyright 2021 The Apache Software Foundation or its licensors, as applicable.