Package org.apache.poi.xwpf.usermodel
Class XWPFComment
java.lang.Object
org.apache.poi.xwpf.usermodel.XWPFComment
- All Implemented Interfaces:
IBody
Sketch of XWPF comment class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateTable(int rows, int cols) Get the author of the current commentGets the body elements (IBodyElement) of the comment.The owning object for this commentGets the underlying CTComment object for the comment.getDate()Get the date information of the current commentgetId()Get a unique identifier for the current comment.Get the initials of the author of the current commentgetParagraph(CTP p) Returns the paragraph corresponding to the providedCTP.getParagraphArray(int pos) Returns the paragraph that of position posReturns the paragraph(s) that holds the text of the comment.getPart()Get the Part to which the comment belongs, which you need for adding relationships to other partsGet the part typeBodyTypeof the comment.getTableArray(int pos) Returns the table at position posgetTableCell(CTTc cell) returns the TableCell to which the Table belongsGet the list ofXWPFTables in the comment.getText()Get theXWPFDocumentthe comment is part of.insertNewParagraph(XmlCursor cursor) inserts a new paragraph at position of the cursorinsertNewTbl(XmlCursor cursor) inserts a new Table at the cursor position.voidinsertTable(int pos, XWPFTable table) inserts a new Table at position posvoidremoveParagraph(XWPFParagraph paragraph) voidremoveTable(XWPFTable table) voidSpecifies the author for the current comment If this attribute is omitted, then no author shall be associated with the parent annotation type.voidSpecifies the date information for the current comment.voidsetInitials(String initials) Specifies the initials of the author of the current comment
-
Constructor Details
-
XWPFComment
-
-
Method Details
-
getPart
Get the Part to which the comment belongs, which you need for adding relationships to other parts- Specified by:
getPartin interfaceIBody- Returns:
POIXMLDocumentPartthat contains the comment.- See Also:
-
getPartType
Get the part typeBodyTypeof the comment.- Specified by:
getPartTypein interfaceIBody- Returns:
- The
BodyTypevalue. - See Also:
-
getBodyElements
Gets the body elements (IBodyElement) of the comment.- Specified by:
getBodyElementsin interfaceIBody- Returns:
- List of body elements.
-
getParagraphs
Returns the paragraph(s) that holds the text of the comment.- Specified by:
getParagraphsin interfaceIBody
-
getTables
Get the list ofXWPFTables in the comment. -
getParagraph
Description copied from interface:IBodyReturns the paragraph corresponding to the providedCTP.- Specified by:
getParagraphin interfaceIBody- Parameters:
p- is instance of CTP and is searching for an XWPFParagraph- Returns:
- The paragraph corresponding to the
CTP, ornullif there is no corresponding paragraph in this body.
-
getTable
Description copied from interface:IBody -
getParagraphArray
Description copied from interface:IBodyReturns the paragraph that of position pos- Specified by:
getParagraphArrayin interfaceIBody
-
getTableArray
Description copied from interface:IBodyReturns the table at position pos- Specified by:
getTableArrayin interfaceIBody
-
insertNewParagraph
Description copied from interface:IBodyinserts a new paragraph at position of the cursor- Specified by:
insertNewParagraphin interfaceIBody
-
insertNewTbl
Description copied from interface:IBodyinserts a new Table at the cursor position.- Specified by:
insertNewTblin interfaceIBody
-
insertTable
Description copied from interface:IBodyinserts a new Table at position pos- Specified by:
insertTablein interfaceIBody
-
getTableCell
Description copied from interface:IBodyreturns the TableCell to which the Table belongs- Specified by:
getTableCellin interfaceIBody
-
getXWPFDocument
Get theXWPFDocumentthe comment is part of.- Specified by:
getXWPFDocumentin interfaceIBody- See Also:
-
getText
-
createParagraph
-
removeParagraph
-
removeTable
-
createTable
-
getCtComment
Gets the underlying CTComment object for the comment.- Returns:
- CTComment object
-
getComments
The owning object for this comment- Returns:
- The
XWPFCommentsobject that contains this comment.
-
getId
Get a unique identifier for the current comment. The restrictions on the id attribute, if any, are defined by the parent XML element. If this attribute is omitted, then the document is non-conformant.- Returns:
- string id
-
getAuthor
Get the author of the current comment- Returns:
- author of the current comment
-
setAuthor
Specifies the author for the current comment If this attribute is omitted, then no author shall be associated with the parent annotation type.- Parameters:
author- author of the current comment
-
getInitials
Get the initials of the author of the current comment- Returns:
- initials the initials of the author of the current comment
-
setInitials
Specifies the initials of the author of the current comment- Parameters:
initials- the initials of the author of the current comment
-
getDate
Get the date information of the current comment- Returns:
- the date information for the current comment.
-
setDate
Specifies the date information for the current comment. If this attribute is omitted, then no date information shall be associated with the parent annotation type.- Parameters:
date- the date information for the current comment.
-