public class XWPFEndnotes extends XWPFAbstractFootnotesEndnotes
XWPFEndnote
).
(照看文档的尾注集合。托管结束注释 (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
(在文档中添加 XWPFEndnote)
|
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.
(在 Endnotes 部分获取 XWPFEndnote 的列表。)
|
XWPFEndnote |
getFootnoteById(int id)
Get the end note with the specified ID, if any.
(获取具有指定 ID 的尾注(如果有)。)
|
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, toString
protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEndnotes ctEndnotes
public XWPFEndnotes()
public XWPFEndnotes(PackagePart part)
part
- the package part holding the data of the footnotes,
(part - 包含脚注数据的包部分,)
@Internal public void setEndnotes(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEndnotes endnotes)
endnotes
- The endnotes to be added.
(endnotes - 要添加的尾注。)
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 read
(java.io.IOException - 读取文档时子类可能会抛出 IOException)
protected 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(); }(将内容保存在底层包部分中。默认实现是空的,这意味着包部分保持不变。子类应覆盖并添加逻辑以将“模型”编组到 Ooxml4J。例如,保存通用 XML 条目的代码可能如下所示: protected void commit() throws IOException { PackagePart part = getPackagePart();输出流输出 = part.getOutputStream(); XmlObject bean = getXmlBean(); //保存内存变化的“模型” 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 committed
(java.io.IOException - 如果无法提交更改,子类可能会抛出 IOException)
public void addEndnote(XWPFEndnote endnote)
XWPFEndnote
to the document
(在文档中添加 XWPFEndnote)
endnote
-
(尾注——)
java.io.IOException
(java.io.IOException)
@Internal public XWPFEndnote addEndnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
note
- Note to add
(note - 要添加的注释)
XWPFEndnote
(新 XWPF 尾注)
java.io.IOException
(java.io.IOException)
public XWPFEndnote getFootnoteById(int id)
getFootnoteById
in class
XWPFAbstractFootnotesEndnotes
id
- End note ID.
(id - 尾注 ID。)
public java.util.List<XWPFEndnote> getEndnotesList()
XWPFEndnote
in the Endnotes part.
(在 Endnotes 部分获取 XWPFEndnote 的列表。)
public boolean removeEndnote(int pos)
pos
- Array position of the endnote to be removed
(pos - 要删除的尾注的数组位置)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.