public class XWPFFootnotes extends XWPFAbstractFootnotesEndnotes
XWPFFootnote
).
(处理文档的脚注集合。管理页面底部脚注 (XWPFFootnote)。)
POIXMLDocumentPart.RelationPart
Modifier and Type | Field and Description |
---|---|
protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes |
ctFootnotes |
document, listFootnote
Constructor and Description |
---|
XWPFFootnotes()
Construct XWPFFootnotes from scratch for a new document.
|
XWPFFootnotes(PackagePart part)
Construct XWPFFootnotes from a package part
|
Modifier and Type | Method and Description |
---|---|
XWPFFootnote |
addFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
Add a CT footnote to the document
(在文档中添加 CT 脚注)
|
void |
addFootnote(XWPFFootnote footnote)
Add an
XWPFFootnote to the document
(在文档中添加 XWPFFootnote)
|
protected void |
commit()
Save the content in the underlying package part.
(将内容保存在底层包部分中。)
|
XWPFFootnote |
createFootnote()
Create a new footnote and add it to the document.
(创建一个新的脚注并将其添加到文档中。)
|
java.util.List<XWPFFootnote> |
getFootnotesList()
Get the list of
XWPFFootnote in the Footnotes part.
(在脚注部分获取 XWPFFootnote 列表。)
|
protected void |
onDocumentRead()
Read document
(阅读文件)
|
boolean |
removeFootnote(int pos)
Remove the specified footnote if present.
(删除指定的脚注(如果存在)。)
|
void |
setFootnotes(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes footnotes)
Sets the ctFootnotes
(设置 ctFootnotes)
|
getFootnoteById, 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.CTFootnotes ctFootnotes
public XWPFFootnotes(PackagePart part)
part
- the package part holding the data of the footnotes,
(part - 包含脚注数据的包部分,)
public XWPFFootnotes()
@Internal public void setFootnotes(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes footnotes)
footnotes
- Collection of CTFntEdn objects.
(脚注 - CTFntEdn 对象的集合。)
public XWPFFootnote createFootnote()
XWPFFootnote
(新 XWPF 脚注)
public boolean removeFootnote(int pos)
pos
- Array position of the footnote to be removed
(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 addFootnote(XWPFFootnote footnote)
XWPFFootnote
to the document
(在文档中添加 XWPFFootnote)
footnote
- Footnote to add
(footnote - 要添加的脚注)
java.io.IOException
(java.io.IOException)
@Internal public XWPFFootnote addFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
note
- CTFtnEdn to add.
(注意 - 要添加的 CTFtnEdn。)
java.io.IOException
(java.io.IOException)
public java.util.List<XWPFFootnote> getFootnotesList()
XWPFFootnote
in the Footnotes part.
(在脚注部分获取 XWPFFootnote 列表。)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.