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, isCommited, onDocumentCreate, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommited, toString
protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEndnotes ctEndnotes
public XWPFEndnotes()
public XWPFEndnotes(PackagePart part) throws java.io.IOException, OpenXML4JException
part
- the package part holding the data of the footnotes,java.io.IOException
OpenXML4JException
@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 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 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 addXWPFEndnote
java.io.IOException
public XWPFEndnote getFootnoteById(int id)
getFootnoteById
in class XWPFAbstractFootnotesEndnotes
id
- 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 2018 The Apache Software Foundation or its licensors, as applicable.