Comment

Overview

Comment is a class in Aspose.Words FOSS for Java. Inherits from: InlineStory, INodeWithAnnotationId, IMoveTrackableNode.

Represents a container for text of a comment.

Edition status of its 57 listed members (a property and its accessor methods are listed separately, overloads once): 57 not yet exercised by a verified example.

This class declares 37 methods for Comment objects in Java programs. Available methods include: Comment, accept, acceptEnd, acceptStart, addReply, ensureMinimum, getAncestor, getAuthor, getDateTime, getDateTimeUtc, getDone, getFirstParagraph, and 24 additional methods. Public members are accessible to any Java application after installing the Aspose.Words FOSS for Java package. Properties: ancestor, author, dateTime, dateTimeUtc, deleteRevision, done, and 15 more.

Properties

NameTypeAccessDescription
nodeTypeintReadReturns Comment.
storyTypeintReadReturns StoryType.COMMENTS.
idintRead/WriteGets or sets the comment identifier.
initialStringRead/WriteReturns or sets the initials of the user associated with a specific comment.
dateTimejava.util.DateRead/WriteGets or sets the date time.
dateTimeUtcjava.util.DateReadGets the date time utc.
authorStringRead/WriteReturns or sets the author name for a comment.
ancestorCommentReadGets the ancestor.
repliesCommentCollectionReadReturns a collection of Comment objects that are immediate children of the specified comment.
donebooleanRead/WriteGets or sets flag indicating that the comment has been marked done.
parentIdintRead/WriteGets or sets the parent comment ID.
parentParagraphParagraphReadRetrieves the parent Paragraph of this node.
firstParagraphParagraphReadGets the first paragraph in the story.
lastParagraphParagraphReadGets the last paragraph in the story.
paragraphsParagraphCollectionReadGets a collection of paragraphs that are immediate children of the story.
tablesTableCollectionReadGets a collection of tables that are immediate children of the story.
insertRevisionbooleanReadGets the insert revision.
deleteRevisionbooleanReadGets the delete revision.
moveFromRevisionbooleanReadGets the move from revision.
moveToRevisionbooleanReadGets the move to revision.
fontFontReadProvides access to the font formatting of the anchor character of this object.

Methods

SignatureDescription
Comment(doc: DocumentBase)Initializes a new instance of the Comment class.
Comment(doc: DocumentBase, author: String, initial: String, dateTime: java.util.Date)Creates a new Comment instance from doc, author, initial, dateTime.
getNodeType() → intReturns Comment.
getStoryType() → intReturns StoryType.COMMENTS.
getId() → intGets or sets the comment identifier.
setId(value: int)Sets the id value.
getInitial() → StringReturns or sets the initials of the user associated with a specific comment.
setInitial(value: String)Sets the initial value.
getDateTime() → java.util.DateReturns the date time.
setDateTime(value: java.util.Date)Sets the date time value.
getDateTimeUtc() → java.util.DateReturns the date time utc.
getAuthor() → StringReturns or sets the author name for a comment.
setAuthor(value: String)Sets the author value.
accept(visitor: DocumentVisitor) → booleanCalls accept(visitor) on this Comment instance.
addReply(author: String, initial: String, dateTime: java.util.Date, text: String) → CommentCalls addReply(author, initial, dateTime, text) on this Comment instance.
removeReply(reply: Comment)Removes the specified reply to this comment.
removeAllReplies()Removes all replies to this comment.
acceptStart(visitor: DocumentVisitor) → intAccepts a visitor for visiting the start of the comment.
acceptEnd(visitor: DocumentVisitor) → intAccepts a visitor for visiting the end of the comment.
setText(text: String)This is a convenience method that allows to easily set text of the comment.
getAncestor() → CommentReturns the ancestor.
getReplies() → CommentCollectionReturns a collection of Comment objects that are immediate children of the specified comment.
getDone() → booleanGets or sets flag indicating that the comment has been marked done.
setDone(value: boolean)Sets the done value.
getParentId() → intGets or sets the parent comment ID.
setParentId(value: int)Sets the parent id value.
getParentParagraph() → ParagraphRetrieves the parent Paragraph of this node.
getFirstParagraph() → ParagraphGets the first paragraph in the story.
getLastParagraph() → ParagraphGets the last paragraph in the story.
getParagraphs() → ParagraphCollectionGets a collection of paragraphs that are immediate children of the story.
getTables() → TableCollectionGets a collection of tables that are immediate children of the story.
isInsertRevision() → booleanReturns true if insert revision is set.
isDeleteRevision() → booleanReturns true if delete revision is set.
isMoveFromRevision() → booleanReturns true if move from revision is set.
isMoveToRevision() → booleanReturns true if move to revision is set.
getFont() → FontProvides access to the font formatting of the anchor character of this object.
ensureMinimum()If the last child is not a paragraph, creates and appends one empty paragraph.

See Also