public class XWPFFootnotes extends POIXMLDocumentPart
| Modifier and Type | Field and Description |
|---|---|
protected XWPFDocument |
document |
DEFAULT_XML_OPTIONS| Constructor and Description |
|---|
XWPFFootnotes()
Construct XWPFFootnotes from scratch for a new document.
|
XWPFFootnotes(PackagePart part,
PackageRelationship rel)
Construct XWPFFootnotes from a package part
|
| Modifier and Type | Method and Description |
|---|---|
XWPFFootnote |
addFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
add a 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 |
getFootnoteById(int id) |
List<XWPFFootnote> |
getFootnotesList() |
XWPFDocument |
getXWPFDocument() |
protected void |
onDocumentRead()
Read document
|
void |
setFootnotes(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes footnotes)
Sets the ctFootnotes
|
void |
setXWPFDocument(XWPFDocument doc) |
addRelation, clearMemoryPackagePart, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationCounter, getRelationId, getRelations, getTargetPart, onDocumentCreate, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, toStringprotected XWPFDocument document
public XWPFFootnotes(PackagePart part, PackageRelationship rel) throws IOException, OpenXML4JException
part - the package part holding the data of the footnotes,rel - the package relationship of type "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes"IOExceptionOpenXML4JExceptionpublic XWPFFootnotes()
protected void onDocumentRead()
throws IOException
onDocumentRead in class POIXMLDocumentPartIOExceptionprotected void commit()
throws IOException
POIXMLDocumentPart
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 POIXMLDocumentPartIOExceptionpublic List<XWPFFootnote> getFootnotesList()
public XWPFFootnote getFootnoteById(int id)
public void setFootnotes(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes footnotes)
footnotes - public void addFootnote(XWPFFootnote footnote)
footnote - IOExceptionpublic XWPFFootnote addFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
note - IOExceptionpublic void setXWPFDocument(XWPFDocument doc)
public XWPFDocument getXWPFDocument()
IBody.getPart()Copyright © 2020. All rights reserved.