public class XWPFEndnotes extends XWPFAbstractFootnotesEndnotes
XWPFEndnote).POIXMLDocumentPart.RelationPart| Modifier and Type | Field and Description |
|---|---|
protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEndnotes |
ctEndnotes |
document, listFootnote| Constructor and Description |
|---|
XWPFEndnotes() |
XWPFEndnotes(PackagePart part)
Construct XWPFEndnotes from a package part
|
| Modifier and Type | Method and Description |
|---|---|
XWPFEndnote |
addEndnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
Add an endnote to the document
|
void |
addEndnote(XWPFEndnote endnote)
add an
XWPFEndnote to the document |
protected void |
commit()
Save the content in the underlying package part.
|
XWPFEndnote |
createEndnote()
Create a new end note and add it to the document.
|
java.util.List<XWPFEndnote> |
getEndnotesList()
Get the list of
XWPFEndnote in the Endnotes part. |
XWPFEndnote |
getFootnoteById(int id)
Get the end note with the specified ID, if any.
|
protected void |
onDocumentRead()
Read document
|
boolean |
removeEndnote(int pos)
Remove the specified end note if present.
|
boolean |
removeFootnote(int pos)
Remove the specified footnote if present.
|
void |
setEndnotes(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEndnotes endnotes)
Set the end notes for this part.
|
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, toStringprotected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEndnotes ctEndnotes
public XWPFEndnotes()
public XWPFEndnotes(PackagePart part)
part - the package part holding the data of the footnotes,@Internal public void setEndnotes(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEndnotes endnotes)
endnotes - The endnotes to be added.public XWPFEndnote createEndnote()
public boolean removeFootnote(int pos)
pos - protected void onDocumentRead()
throws java.io.IOException
onDocumentRead in class POIXMLDocumentPartjava.io.IOException - a subclass may throw an IOException when a document is readprotected void commit()
throws java.io.IOException
POIXMLDocumentPartSub-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 POIXMLDocumentPartjava.io.IOException - a subclass may throw an IOException if the changes can't be committedpublic void addEndnote(XWPFEndnote endnote)
XWPFEndnote to the documentendnote - java.io.IOException@Internal public XWPFEndnote addEndnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
note - Note to addXWPFEndnotejava.io.IOExceptionpublic XWPFEndnote getFootnoteById(int id)
getFootnoteById in class XWPFAbstractFootnotesEndnotesid - End note ID.public java.util.List<XWPFEndnote> getEndnotesList()
XWPFEndnote in the Endnotes part.public boolean removeEndnote(int pos)
pos - Array position of the endnote to be removedCopyright 2021 The Apache Software Foundation or its licensors, as applicable.