Interface Comment

All Known Implementing Classes:
CommentWrapper, StandardComment

public interface Comment
The Comment interface provides methods for managing comments in a document.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the children of the comment.
    org.docx4j.wml.Comments.Comment
    Retrieves the comment associated with this object.
    org.docx4j.wml.CommentRangeEnd
    Retrieves the CommentRangeEnd object associated with this comment.
    org.docx4j.wml.CommentRangeStart
    Retrieves the CommentRangeStart object associated with this comment.
    org.docx4j.wml.R.CommentReference
    Retrieves the R.CommentReference object associated with this comment.
    org.docx4j.openpackaging.packages.WordprocessingMLPackage
    Retrieves the WordprocessingMLPackage document.
    Retrieves the elements in the document that are between the comment range anchors.
    org.docx4j.wml.ContentAccessor
    Retrieves the parent of the comment.
    default List<Object>
    Deprecated, for removal: This API element is subject to removal in a future version.
    removed for replacement by getElements() which doesn't imply a specific usage
    org.docx4j.openpackaging.packages.WordprocessingMLPackage
    getSubTemplate(org.docx4j.openpackaging.packages.WordprocessingMLPackage document)
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    setChildren(Set<Comment> comments)
    Sets the children of the comment.
    void
    setComment(org.docx4j.wml.Comments.Comment comment)
    Sets the comment for this object.
    void
    setCommentRangeEnd(org.docx4j.wml.CommentRangeEnd commentRangeEnd)
    Sets the CommentRangeEnd object associated with this comment.
    void
    setCommentRangeStart(org.docx4j.wml.CommentRangeStart commentRangeStart)
    Sets the CommentRangeStart object associated with this comment.
    void
    setCommentReference(org.docx4j.wml.R.CommentReference commentReference)
    Sets the comment reference for this comment.
    org.docx4j.openpackaging.packages.WordprocessingMLPackage
    tryBuildingSubtemplate(org.docx4j.openpackaging.packages.WordprocessingMLPackage document)
    Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getParent

      org.docx4j.wml.ContentAccessor getParent()
      Retrieves the parent of the comment.
      Returns:
      the parent of the comment
    • getRepeatElements

      @Deprecated(since="1.6.8", forRemoval=true) default List<Object> getRepeatElements()
      Deprecated, for removal: This API element is subject to removal in a future version.
      removed for replacement by getElements() which doesn't imply a specific usage
      Retrieves the elements in the document that are between the comment range anchors.
      Returns:
      a list of objects representing the elements between the comment range anchors.
    • getElements

      List<Object> getElements()
      Retrieves the elements in the document that are between the comment range anchors.
      Returns:
      a list of objects representing the elements between the comment range anchors.
    • getSubTemplate

      @Deprecated(since="1.6.8", forRemoval=true) org.docx4j.openpackaging.packages.WordprocessingMLPackage getSubTemplate(org.docx4j.openpackaging.packages.WordprocessingMLPackage document) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new document containing only the elements between the comment range anchors.
      Parameters:
      document - the document from which to copy the elements.
      Returns:
      a new document containing only the elements between the comment range anchors.
      Throws:
      Exception - if the sub template could not be created.
    • tryBuildingSubtemplate

      @Deprecated(since="1.6.8", forRemoval=true) org.docx4j.openpackaging.packages.WordprocessingMLPackage tryBuildingSubtemplate(org.docx4j.openpackaging.packages.WordprocessingMLPackage document)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tries to build a subtemplate from the given WordprocessingMLPackage document.
      Parameters:
      document - the source document from which to build the subtemplate
      Returns:
      the built subtemplate as a WordprocessingMLPackage
    • getCommentRangeEnd

      org.docx4j.wml.CommentRangeEnd getCommentRangeEnd()
      Retrieves the CommentRangeEnd object associated with this comment.
      Returns:
      the CommentRangeEnd object associated with this comment
    • setCommentRangeEnd

      void setCommentRangeEnd(org.docx4j.wml.CommentRangeEnd commentRangeEnd)
      Sets the CommentRangeEnd object associated with this comment.
      Parameters:
      commentRangeEnd - the CommentRangeEnd object to set
    • getCommentRangeStart

      org.docx4j.wml.CommentRangeStart getCommentRangeStart()
      Retrieves the CommentRangeStart object associated with this comment.
      Returns:
      the CommentRangeStart object associated with this comment
    • setCommentRangeStart

      void setCommentRangeStart(org.docx4j.wml.CommentRangeStart commentRangeStart)
      Sets the CommentRangeStart object associated with this comment.
      Parameters:
      commentRangeStart - the CommentRangeStart object to set
    • getCommentReference

      org.docx4j.wml.R.CommentReference getCommentReference()
      Retrieves the R.CommentReference object associated with this comment.
      Returns:
      the R.CommentReference object associated with this comment
    • setCommentReference

      void setCommentReference(org.docx4j.wml.R.CommentReference commentReference)
      Sets the comment reference for this comment.
      Parameters:
      commentReference - the comment reference to set
    • getChildren

      Set<Comment> getChildren()
      Retrieves the children of the comment.
      Returns:
      a set of Comment objects representing the children of the comment
    • setChildren

      void setChildren(Set<Comment> comments)
      Sets the children of the comment.
      Parameters:
      comments - the set of Comment objects representing the children of the comment
    • getComment

      org.docx4j.wml.Comments.Comment getComment()
      Retrieves the comment associated with this object.
      Returns:
      the comment associated with this object
    • setComment

      void setComment(org.docx4j.wml.Comments.Comment comment)
      Sets the comment for this object.
      Parameters:
      comment - the comment to set
    • getDocument

      org.docx4j.openpackaging.packages.WordprocessingMLPackage getDocument()
      Retrieves the WordprocessingMLPackage document.
      Returns:
      the WordprocessingMLPackage document.