- All Known Implementing Classes:
CommentWrapper,StandardComment
public interface Comment
The Comment interface provides methods for managing comments in a document.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the children of the comment.org.docx4j.wml.Comments.CommentRetrieves the comment associated with this object.org.docx4j.wml.CommentRangeEndRetrieves theCommentRangeEndobject associated with this comment.org.docx4j.wml.CommentRangeStartRetrieves the CommentRangeStart object associated with this comment.org.docx4j.wml.R.CommentReferenceRetrieves theR.CommentReferenceobject associated with this comment.org.docx4j.openpackaging.packages.WordprocessingMLPackageRetrieves the WordprocessingMLPackage document.Retrieves the elements in the document that are between the comment range anchors.org.docx4j.wml.ContentAccessorRetrieves the parent of the comment.Deprecated, for removal: This API element is subject to removal in a future version.org.docx4j.openpackaging.packages.WordprocessingMLPackagegetSubTemplate(org.docx4j.openpackaging.packages.WordprocessingMLPackage document) Deprecated, for removal: This API element is subject to removal in a future version.useCommentUtil.createSubWordDocument(Comment)insteadvoidsetChildren(Set<Comment> comments) Sets the children of the comment.voidsetComment(org.docx4j.wml.Comments.Comment comment) Sets the comment for this object.voidsetCommentRangeEnd(org.docx4j.wml.CommentRangeEnd commentRangeEnd) Sets theCommentRangeEndobject associated with this comment.voidsetCommentRangeStart(org.docx4j.wml.CommentRangeStart commentRangeStart) Sets the CommentRangeStart object associated with this comment.voidsetCommentReference(org.docx4j.wml.R.CommentReference commentReference) Sets the comment reference for this comment.org.docx4j.openpackaging.packages.WordprocessingMLPackagetryBuildingSubtemplate(org.docx4j.openpackaging.packages.WordprocessingMLPackage document) Deprecated, for removal: This API element is subject to removal in a future version.useCommentUtil.createSubWordDocument(Comment)instead
-
Method Details
-
getParent
org.docx4j.wml.ContentAccessor getParent()Retrieves the parent of the comment.- Returns:
- the parent of the comment
-
getRepeatElements
Deprecated, for removal: This API element is subject to removal in a future version.removed for replacement bygetElements()which doesn't imply a specific usageRetrieves 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
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.useCommentUtil.createSubWordDocument(Comment)insteadCreates 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.useCommentUtil.createSubWordDocument(Comment)insteadTries 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 theCommentRangeEndobject associated with this comment.- Returns:
- the
CommentRangeEndobject associated with this comment
-
setCommentRangeEnd
void setCommentRangeEnd(org.docx4j.wml.CommentRangeEnd commentRangeEnd) Sets theCommentRangeEndobject associated with this comment.- Parameters:
commentRangeEnd- theCommentRangeEndobject 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 theR.CommentReferenceobject associated with this comment.- Returns:
- the
R.CommentReferenceobject 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
Retrieves the children of the comment.- Returns:
- a set of Comment objects representing the children of the comment
-
setChildren
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.
-
getElements()which doesn't imply a specific usage