Package com.adobe.granite.comments
Class AbstractCommentCollection<C extends Comment>
java.lang.Object
com.adobe.granite.comments.AbstractCommentCollection<C>
- All Implemented Interfaces:
CommentCollection<C>
@ConsumerType
public abstract class AbstractCommentCollection<C extends Comment>
extends Object
implements CommentCollection<C>
The
AbstractCommentCollection implements a CommentCollection and provides basic implementation
of the API, providing abstract methods so that concrete implementations can control storage and retrieval of
resources.-
Method Summary
Modifier and TypeMethodDescriptionfinal CaddComment(String message, String author, String annotationData) Create a new comment and add it to the collection.Returns all comments of this collection.final CalendarReturns the moment in time this collection was created.final CalendarReturns the moment in time this collection was last modified.final StringgetPath()Returns the path of the resource representing this collection.final ResourceReturns theResourcerepresenting the target this comment collection belongs to.final voidremove()Removes (deletes) this comment collection.
-
Method Details
-
addComment
public final C addComment(String message, String author, String annotationData) throws CommentException Create a new comment and add it to the collection. The comment will be created with the given message, optional author user ID string and optional annotation data.- Specified by:
addCommentin interfaceCommentCollection<C extends Comment>- Parameters:
message- The message of the comment.author- The optional user ID to set as the author of the new comment. If none is provided, the session user is considered the author.annotationData- The optional annotation data. Annotation data may be used to store SVG data when commenting on an image that is annotated with such data.- Returns:
- The comment just created.
- Throws:
CommentException- Upon encountering an error during comment creation.
-
getCommentList
Returns all comments of this collection.- Specified by:
getCommentListin interfaceCommentCollection<C extends Comment>- Returns:
- A
Listof comments of this collection, or an empty list if no comments are present.
-
getCreated
Description copied from interface:CommentCollectionReturns the moment in time this collection was created.- Specified by:
getCreatedin interfaceCommentCollection<C extends Comment>- Returns:
- The calendar representing the creation date/time.
-
getLastModified
Description copied from interface:CommentCollectionReturns the moment in time this collection was last modified.- Specified by:
getLastModifiedin interfaceCommentCollection<C extends Comment>- Returns:
- The calendar representing the last modification.
-
getPath
Returns the path of the resource representing this collection.- Specified by:
getPathin interfaceCommentCollection<C extends Comment>- Returns:
- A
Stringrepresenting the path.
-
getTarget
Returns theResourcerepresenting the target this comment collection belongs to.- Specified by:
getTargetin interfaceCommentCollection<C extends Comment>- Returns:
- The resource.
-
remove
public final void remove()Removes (deletes) this comment collection. After calling this method, the collection must be considered invalid/stale and must not be used anymore.- Specified by:
removein interfaceCommentCollection<C extends Comment>
-