Class XWPFComment

  • All Implemented Interfaces:
    IBody

    public class XWPFComment
    extends Object
    implements IBody
    Sketch of XWPF comment class
    • Field Detail

      • ctComment

        protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTComment ctComment
    • Constructor Detail

      • XWPFComment

        public XWPFComment​(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTComment ctComment,
                           XWPFComments comments)
    • Method Detail

      • init

        protected void init()
      • getParagraph

        public XWPFParagraph getParagraph​(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
        Description copied from interface: IBody
        Returns the paragraph corresponding to the provided CTP.
        Specified by:
        getParagraph in interface IBody
        Parameters:
        p - is instance of CTP and is searching for an XWPFParagraph
        Returns:
        The paragraph corresponding to the CTP, or null if there is no corresponding paragraph in this body.
      • getTable

        public XWPFTable getTable​(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTable)
        Description copied from interface: IBody
        if there is a corresponding 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
        Specified by:
        getTable in interface IBody
      • getParagraphArray

        public XWPFParagraph getParagraphArray​(int pos)
        Description copied from interface: IBody
        Returns the paragraph that of position pos
        Specified by:
        getParagraphArray in interface IBody
      • getTableArray

        public XWPFTable getTableArray​(int pos)
        Description copied from interface: IBody
        Returns the table at position pos
        Specified by:
        getTableArray in interface IBody
      • insertNewTbl

        public XWPFTable insertNewTbl​(XmlCursor cursor)
        Description copied from interface: IBody
        inserts a new Table at the cursor position.
        Specified by:
        insertNewTbl in interface IBody
      • insertTable

        public void insertTable​(int pos,
                                XWPFTable table)
        Description copied from interface: IBody
        inserts a new Table at position pos
        Specified by:
        insertTable in interface IBody
      • getTableCell

        public XWPFTableCell getTableCell​(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
        Description copied from interface: IBody
        returns the TableCell to which the Table belongs
        Specified by:
        getTableCell in interface IBody
      • getText

        public String getText()
      • removeParagraph

        public void removeParagraph​(XWPFParagraph paragraph)
      • removeTable

        public void removeTable​(XWPFTable table)
      • createTable

        public XWPFTable createTable​(int rows,
                                     int cols)
      • getCtComment

        public org.openxmlformats.schemas.wordprocessingml.x2006.main.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 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 String getAuthor()
        Get the author of the current comment
        Returns:
        author of the current comment
      • setAuthor

        public void setAuthor​(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 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​(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 Calendar getDate()
        Get the date information of the current comment
        Returns:
        the date information for the current comment.
      • setDate

        public void setDate​(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.