public interface IBody
An IBody represents the different parts of the document which can contain collections of Paragraphs and Tables. It provides a common way to work with these and their contents.
Typically, this is something like a XWPFDocument, or one of the parts in it like XWPFHeader, XWPFFooter, XWPFTableCell
(IBody 代表文档的不同部分,其中可以包含段落和表格的集合。它提供了一种处理这些及其内容的通用方法。通常,这类似于 XWPFDocument,或者其中的一个部分,例如 XWPFHeader、XWPFFooter、XWPFTableCell)Modifier and Type | Method and Description |
---|---|
java.util.List<IBodyElement> |
getBodyElements()
Returns an Iterator with paragraphs and tables, in the order that they occur in the text.
(返回具有段落和表格的迭代器,按照它们在文本中出现的顺序。)
|
XWPFParagraph |
getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
Returns the paragraph corresponding to the provided
CTP .
(返回与提供的 CTP 对应的段落。)
|
XWPFParagraph |
getParagraphArray(int pos)
Returns the paragraph that of position pos
(返回位置 pos 的段落)
|
java.util.List<XWPFParagraph> |
getParagraphs()
Returns the paragraph(s) that holds the text of the header or footer.
(返回包含页眉或页脚文本的段落。)
|
POIXMLDocumentPart |
getPart()
returns the Part, to which the body belongs, which you need for adding relationship to other parts Actually it is needed of the class XWPFTableCell.
(返回主体所属的部分,您需要添加与其他部分的关系实际上它是类 XWPFTableCell 所需要的。)
|
BodyType |
getPartType()
get the PartType of the body, for example DOCUMENT, HEADER, FOOTER, FOOTNOTE,
(获取正文的 PartType,例如 DOCUMENT、HEADER、FOOTER、FOOTNOTE、)
|
XWPFTable |
getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTable)
|
XWPFTable |
getTableArray(int pos)
Returns the table at position pos
(返回位置 pos 的表)
|
XWPFTableCell |
getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
returns the TableCell to which the Table belongs
(返回 Table 所属的 TableCell)
|
java.util.List<XWPFTable> |
getTables()
Return the table(s) that holds the text of the IBodyPart, for complex cases where a paragraph isn't used.
(对于不使用段落的复杂情况,返回包含 IBodyPart 文本的表。)
|
XWPFDocument |
getXWPFDocument()
Return XWPFDocument
(返回 XWPF 文档)
|
XWPFParagraph |
insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
inserts a new paragraph at position of the cursor
(在光标位置插入一个新段落)
|
XWPFTable |
insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
inserts a new Table at the cursor position.
(在光标位置插入一个新表。)
|
void |
insertTable(int pos, XWPFTable table)
inserts a new Table at position pos
(在位置 pos 插入一个新表)
|
POIXMLDocumentPart getPart()
BodyType getPartType()
java.util.List<IBodyElement> getBodyElements()
java.util.List<XWPFParagraph> getParagraphs()
java.util.List<XWPFTable> getTables()
XWPFParagraph getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
CTP
.
(返回与提供的 CTP 对应的段落。)
p
- is instance of CTP and is searching for an XWPFParagraph
(p - 是 CTP 的实例,正在搜索 XWPFParagraph)
CTP
, or
null
if there is no corresponding paragraph in this body.
(与 CTP 对应的段落,如果此正文中没有对应的段落,则为 null。)
XWPFTable getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTable)
XWPFTable
of the parameter ctTable in the tableList of this header the method will return this table if there is no corresponding
XWPFTable
the method will return null
(如果该头的tableList中存在参数ctTable对应的XWPFTable,则该方法将返回该表如果没有对应的XWPFTable该方法将返回null)
ctTable
-
(ctTable -)
XWPFParagraph getParagraphArray(int pos)
XWPFTable getTableArray(int pos)
XWPFParagraph insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
cursor
-
(光标 -)
XWPFTable insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
cursor
-
(光标 -)
void insertTable(int pos, XWPFTable table)
pos
-
(邮政 -)
table
-
(桌子 -)
XWPFTableCell getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
cell
-
(细胞 -)
XWPFDocument getXWPFDocument()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.