Class StandardComment
java.lang.Object
pro.verron.officestamper.core.StandardComment
- All Implemented Interfaces:
Comment
-
Constructor Summary
ConstructorsConstructorDescriptionStandardComment(DocxPart part, org.docx4j.wml.CTSmartTagRun startTagRun, org.docx4j.wml.CommentRangeStart commentRangeStart, org.docx4j.wml.CommentRangeEnd commentRangeEnd, org.docx4j.wml.Comments.Comment comment, @Nullable org.docx4j.wml.R.CommentReference commentReference) Constructs a newStandardCommentobject. -
Method Summary
Modifier and TypeMethodDescriptionstatic StandardCommentcreate(DocxPart document, org.docx4j.wml.ContentAccessor parent, String expression, BigInteger id) Creates a new instance ofStandardCommentand initializes it with the given parameters, including a comment, comment range start, comment range end, and a comment reference.Retrieves the expression associated with the implementing entity.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.@Nullable org.docx4j.wml.R.CommentReferenceRetrieves theR.CommentReferenceobject associated with this comment.Retrieves the elements in the document that are between the comment range anchors.getId()Retrieves the ID of this comment.Retrieves the paragraph associated with this comment.org.docx4j.wml.ContentAccessorRetrieves the parent of the comment.org.docx4j.wml.CTSmartTagRunRetrieves the CTSmartTagRun object associated with the start of this comment.toString()Generates a string representation of theStandardCommentobject, including its ID, content, and the amount children comment.
-
Constructor Details
-
StandardComment
public StandardComment(DocxPart part, org.docx4j.wml.CTSmartTagRun startTagRun, org.docx4j.wml.CommentRangeStart commentRangeStart, org.docx4j.wml.CommentRangeEnd commentRangeEnd, org.docx4j.wml.Comments.Comment comment, @Nullable org.docx4j.wml.R.CommentReference commentReference) Constructs a newStandardCommentobject.- Parameters:
part- theDocxPartrepresenting the document section this comment belongs to.startTagRun- the start tag run.commentRangeStart- the comment range start.commentRangeEnd- the comment range end.comment- the comment.commentReference- the comment reference.
-
-
Method Details
-
create
public static StandardComment create(DocxPart document, org.docx4j.wml.ContentAccessor parent, String expression, BigInteger id) Creates a new instance ofStandardCommentand initializes it with the given parameters, including a comment, comment range start, comment range end, and a comment reference.- Parameters:
document- theDocxPartrepresenting the document to which this comment belongsparent- theContentAccessorrepresenting the parent content of the comment rangeexpression- theStringcontent to be included in the commentid- the uniqueBigIntegeridentifier for the comment- Returns:
- a
StandardCommentinstance initialized with the specified parameters
-
toString
Generates a string representation of theStandardCommentobject, including its ID, content, and the amount children comment.- Overrides:
toStringin classObject- Returns:
- a formatted string describing the
StandardComment's properties, including its ID, content, and the size of its children.
-
getParagraph
Description copied from interface:CommentRetrieves the paragraph associated with this comment.- Specified by:
getParagraphin interfaceComment- Returns:
- the
Paragraphobject associated with this comment
-
getStartTagRun
public org.docx4j.wml.CTSmartTagRun getStartTagRun()Description copied from interface:CommentRetrieves the CTSmartTagRun object associated with the start of this comment.- Specified by:
getStartTagRunin interfaceComment- Returns:
- the
CTSmartTagRunobject representing the start tag run of the comment
-
getCommentRangeStart
public org.docx4j.wml.CommentRangeStart getCommentRangeStart()Description copied from interface:CommentRetrieves the CommentRangeStart object associated with this comment.- Specified by:
getCommentRangeStartin interfaceComment- Returns:
- the
CommentRangeStartobject associated with this comment
-
getParent
-
getElements
Description copied from interface:CommentRetrieves the elements in the document that are between the comment range anchors.- Specified by:
getElementsin interfaceComment- Returns:
- a list of objects representing the elements between the comment range anchors.
-
getCommentRangeEnd
public org.docx4j.wml.CommentRangeEnd getCommentRangeEnd()Description copied from interface:CommentRetrieves theCommentRangeEndobject associated with this comment.- Specified by:
getCommentRangeEndin interfaceComment- Returns:
- the
CommentRangeEndobject associated with this comment
-
getCommentReference
public @Nullable org.docx4j.wml.R.CommentReference getCommentReference()Description copied from interface:CommentRetrieves theR.CommentReferenceobject associated with this comment.- Specified by:
getCommentReferencein interfaceComment- Returns:
- the
R.CommentReferenceobject associated with this comment
-
getComment
public org.docx4j.wml.Comments.Comment getComment()Description copied from interface:CommentRetrieves the comment associated with this object.- Specified by:
getCommentin interfaceComment- Returns:
- the comment associated with this object
-
expression
Description copied from interface:CommentRetrieves the expression associated with the implementing entity.- Specified by:
expressionin interfaceComment- Returns:
- a string representing the expression
-
getId
Description copied from interface:CommentRetrieves the ID of this comment.
-