Package org.apache.poi.xwpf.usermodel
Class XWPFComment
- java.lang.Object
-
- org.apache.poi.xwpf.usermodel.XWPFComment
-
-
Constructor Summary
Constructors Constructor Description XWPFComment(CTComment ctComment, XWPFComments comments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XWPFParagraph
createParagraph()
XWPFTable
createTable(int rows, int cols)
java.lang.String
getAuthor()
Get the author of the current commentjava.util.List<IBodyElement>
getBodyElements()
Gets the body elements (IBodyElement
) of the comment.XWPFComments
getComments()
The owning object for this commentCTComment
getCtComment()
Gets the underlying CTComment object for the comment.java.util.Calendar
getDate()
Get the date information of the current commentjava.lang.String
getId()
Get a unique identifier for the current comment.java.lang.String
getInitials()
Get the initials of the author of the current commentXWPFParagraph
getParagraph(CTP p)
Returns the paragraph corresponding to the providedCTP
.XWPFParagraph
getParagraphArray(int pos)
Returns the paragraph that of position posjava.util.List<XWPFParagraph>
getParagraphs()
Returns the paragraph(s) that holds the text of the comment.POIXMLDocumentPart
getPart()
Get the Part to which the comment belongs, which you need for adding relationships to other partsBodyType
getPartType()
Get the part typeBodyType
of the comment.XWPFTable
getTable(CTTbl ctTable)
XWPFTable
getTableArray(int pos)
Returns the table at position posXWPFTableCell
getTableCell(CTTc cell)
returns the TableCell to which the Table belongsjava.util.List<XWPFTable>
getTables()
Get the list ofXWPFTable
s in the comment.java.lang.String
getText()
XWPFDocument
getXWPFDocument()
Get theXWPFDocument
the comment is part of.XWPFParagraph
insertNewParagraph(XmlCursor cursor)
inserts a new paragraph at position of the cursorXWPFTable
insertNewTbl(XmlCursor cursor)
inserts a new Table at the cursor position.void
insertTable(int pos, XWPFTable table)
inserts a new Table at position posvoid
removeParagraph(XWPFParagraph paragraph)
void
removeTable(XWPFTable table)
void
setAuthor(java.lang.String author)
Specifies the author for the current comment If this attribute is omitted, then no author shall be associated with the parent annotation type.void
setDate(java.util.Calendar date)
Specifies the date information for the current comment.void
setInitials(java.lang.String initials)
Specifies the initials of the author of the current comment
-
-
-
Constructor Detail
-
XWPFComment
public XWPFComment(CTComment ctComment, XWPFComments comments)
-
-
Method Detail
-
getPart
public POIXMLDocumentPart getPart()
Get the Part to which the comment belongs, which you need for adding relationships to other parts- Specified by:
getPart
in interfaceIBody
- Returns:
POIXMLDocumentPart
that contains the comment.- See Also:
IBody.getPart()
-
getPartType
public BodyType getPartType()
Get the part typeBodyType
of the comment.- Specified by:
getPartType
in interfaceIBody
- Returns:
- The
BodyType
value. - See Also:
IBody.getPartType()
-
getBodyElements
public java.util.List<IBodyElement> getBodyElements()
Gets the body elements (IBodyElement
) of the comment.- Specified by:
getBodyElements
in interfaceIBody
- Returns:
- List of body elements.
-
getParagraphs
public java.util.List<XWPFParagraph> getParagraphs()
Returns the paragraph(s) that holds the text of the comment.- Specified by:
getParagraphs
in interfaceIBody
-
getParagraph
public XWPFParagraph getParagraph(CTP p)
Description copied from interface:IBody
Returns the paragraph corresponding to the providedCTP
.- Specified by:
getParagraph
in interfaceIBody
- Parameters:
p
- is instance of CTP and is searching for an XWPFParagraph- Returns:
- The paragraph corresponding to the
CTP
, ornull
if there is no corresponding paragraph in this body.
-
getParagraphArray
public XWPFParagraph getParagraphArray(int pos)
Description copied from interface:IBody
Returns the paragraph that of position pos- Specified by:
getParagraphArray
in interfaceIBody
-
getTableArray
public XWPFTable getTableArray(int pos)
Description copied from interface:IBody
Returns the table at position pos- Specified by:
getTableArray
in interfaceIBody
-
insertNewParagraph
public XWPFParagraph insertNewParagraph(XmlCursor cursor)
Description copied from interface:IBody
inserts a new paragraph at position of the cursor- Specified by:
insertNewParagraph
in interfaceIBody
-
insertNewTbl
public XWPFTable insertNewTbl(XmlCursor cursor)
Description copied from interface:IBody
inserts a new Table at the cursor position.- Specified by:
insertNewTbl
in interfaceIBody
-
insertTable
public void insertTable(int pos, XWPFTable table)
Description copied from interface:IBody
inserts a new Table at position pos- Specified by:
insertTable
in interfaceIBody
-
getTableCell
public XWPFTableCell getTableCell(CTTc cell)
Description copied from interface:IBody
returns the TableCell to which the Table belongs- Specified by:
getTableCell
in interfaceIBody
-
getXWPFDocument
public XWPFDocument getXWPFDocument()
Get theXWPFDocument
the comment is part of.- Specified by:
getXWPFDocument
in interfaceIBody
- See Also:
IBody.getXWPFDocument()
-
getText
public java.lang.String getText()
-
createParagraph
public XWPFParagraph createParagraph()
-
removeParagraph
public void removeParagraph(XWPFParagraph paragraph)
-
removeTable
public void removeTable(XWPFTable table)
-
createTable
public XWPFTable createTable(int rows, int cols)
-
getCtComment
public CTComment getCtComment()
Gets the underlying CTComment object for the comment.- Returns:
- CTComment object
-
getComments
public XWPFComments getComments()
The owning object for this comment- Returns:
- The
XWPFComments
object that contains this comment.
-
getId
public java.lang.String 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
public java.lang.String getAuthor()
Get the author of the current comment- Returns:
- author of the current comment
-
setAuthor
public void setAuthor(java.lang.String author)
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
public java.lang.String getInitials()
Get the initials of the author of the current comment- Returns:
- initials the initials of the author of the current comment
-
setInitials
public void setInitials(java.lang.String initials)
Specifies the initials of the author of the current comment- Parameters:
initials
- the initials of the author of the current comment
-
getDate
public java.util.Calendar getDate()
Get the date information of the current comment- Returns:
- the date information for the current comment.
-
setDate
public void setDate(java.util.Calendar date)
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.
-
-