Class StandardComment

java.lang.Object
pro.verron.officestamper.core.StandardComment
All Implemented Interfaces:
Comment
Direct Known Subclasses:
CommentWrapper

public class StandardComment extends Object implements Comment

CommentWrapper class.

Since:
1.0.2
Version:
${version}
Author:
Joseph Verron, Tom Hombergs
  • Constructor Summary

    Constructors
    Constructor
    Description
    StandardComment(org.docx4j.openpackaging.packages.WordprocessingMLPackage document)
    Constructs a new StandardComment object.
  • Method Summary

    Modifier and Type
    Method
    Description
    Getter for the field children.
    org.docx4j.wml.Comments.Comment
    Getter for the field comment.
    org.docx4j.wml.CommentRangeEnd
    Getter for the field commentRangeEnd.
    org.docx4j.wml.CommentRangeStart
    Getter for the field commentRangeStart.
    org.docx4j.wml.R.CommentReference
    Getter for the field commentReference.
    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
    getParent.
    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> children)
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface pro.verron.officestamper.api.Comment

    getRepeatElements
  • Constructor Details

    • StandardComment

      public StandardComment(org.docx4j.openpackaging.packages.WordprocessingMLPackage document)
      Constructs a new StandardComment object.
      Parameters:
      document - the WordprocessingMLPackage document instance
  • Method Details

    • getParent

      public org.docx4j.wml.ContentAccessor getParent()

      getParent.

      Specified by:
      getParent in interface Comment
      Returns:
      the comment's author.
    • getElements

      public List<Object> getElements()
      Description copied from interface: Comment
      Retrieves the elements in the document that are between the comment range anchors.
      Specified by:
      getElements in interface Comment
      Returns:
      the elements in the document that are between the comment range anchors.
    • getSubTemplate

      @Deprecated(since="1.6.8", forRemoval=true) public 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.
      Specified by:
      getSubTemplate in interface Comment
      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) public 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.
      Creates a new document containing only the elements between the comment range anchors. If the sub template could not be created, a OfficeStamperException is thrown.
      Specified by:
      tryBuildingSubtemplate in interface Comment
      Parameters:
      document - the document from which to copy the elements.
      Returns:
      a new document containing only the elements between the comment range anchors.
    • getCommentRangeEnd

      public org.docx4j.wml.CommentRangeEnd getCommentRangeEnd()

      Getter for the field commentRangeEnd.

      Specified by:
      getCommentRangeEnd in interface Comment
      Returns:
      a CommentRangeEnd object
    • setCommentRangeEnd

      public void setCommentRangeEnd(org.docx4j.wml.CommentRangeEnd commentRangeEnd)
      Description copied from interface: Comment
      Sets the CommentRangeEnd object associated with this comment.
      Specified by:
      setCommentRangeEnd in interface Comment
      Parameters:
      commentRangeEnd - the CommentRangeEnd object to set
    • getCommentRangeStart

      public org.docx4j.wml.CommentRangeStart getCommentRangeStart()

      Getter for the field commentRangeStart.

      Specified by:
      getCommentRangeStart in interface Comment
      Returns:
      a CommentRangeStart object
    • setCommentRangeStart

      public void setCommentRangeStart(org.docx4j.wml.CommentRangeStart commentRangeStart)
      Description copied from interface: Comment
      Sets the CommentRangeStart object associated with this comment.
      Specified by:
      setCommentRangeStart in interface Comment
      Parameters:
      commentRangeStart - the CommentRangeStart object to set
    • getCommentReference

      public org.docx4j.wml.R.CommentReference getCommentReference()

      Getter for the field commentReference.

      Specified by:
      getCommentReference in interface Comment
      Returns:
      a R.CommentReference object
    • setCommentReference

      public void setCommentReference(org.docx4j.wml.R.CommentReference commentReference)
      Description copied from interface: Comment
      Sets the comment reference for this comment.
      Specified by:
      setCommentReference in interface Comment
      Parameters:
      commentReference - the comment reference to set
    • getChildren

      public Set<Comment> getChildren()

      Getter for the field children.

      Specified by:
      getChildren in interface Comment
      Returns:
      a Set object
    • setChildren

      public void setChildren(Set<Comment> children)
      Description copied from interface: Comment
      Sets the children of the comment.
      Specified by:
      setChildren in interface Comment
      Parameters:
      children - the set of Comment objects representing the children of the comment
    • getComment

      public org.docx4j.wml.Comments.Comment getComment()

      Getter for the field comment.

      Specified by:
      getComment in interface Comment
      Returns:
      a Comments.Comment object
    • setComment

      public void setComment(org.docx4j.wml.Comments.Comment comment)
      Description copied from interface: Comment
      Sets the comment for this object.
      Specified by:
      setComment in interface Comment
      Parameters:
      comment - the comment to set
    • getDocument

      public org.docx4j.openpackaging.packages.WordprocessingMLPackage getDocument()
      Description copied from interface: Comment
      Retrieves the WordprocessingMLPackage document.
      Specified by:
      getDocument in interface Comment
      Returns:
      the WordprocessingMLPackage document.