public class XWPFFootnotes extends POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
Modifier and Type | Field and Description |
---|---|
protected XWPFDocument |
document |
Constructor and Description |
---|
XWPFFootnotes()
Construct XWPFFootnotes from scratch for a new document.
|
XWPFFootnotes(PackagePart part)
Construct XWPFFootnotes from a package part
|
XWPFFootnotes(PackagePart part,
PackageRelationship rel)
Deprecated.
in POI 3.14, scheduled for removal in POI 3.16
|
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) |
java.util.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) |
_invokeOnDocumentRead, addRelation, addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationId, getRelationParts, getRelations, getTargetPart, onDocumentCreate, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, toString
protected XWPFDocument document
public XWPFFootnotes(PackagePart part) throws java.io.IOException, OpenXML4JException
part
- the package part holding the data of the footnotes,java.io.IOException
OpenXML4JException
@Deprecated public XWPFFootnotes(PackagePart part, PackageRelationship rel) throws java.io.IOException, OpenXML4JException
java.io.IOException
OpenXML4JException
public XWPFFootnotes()
protected void onDocumentRead() throws java.io.IOException
onDocumentRead
in class POIXMLDocumentPart
java.io.IOException
protected void commit() throws java.io.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 POIXMLDocumentPart
java.io.IOException
public java.util.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
- java.io.IOException
public XWPFFootnote addFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
note
- java.io.IOException
public XWPFDocument getXWPFDocument()
IBody.getPart()
public void setXWPFDocument(XWPFDocument doc)
Copyright 2017 The Apache Software Foundation or its licensors, as applicable.