Package com.adobe.granite.comments
Interface CommentManager
-
@ProviderType public interface CommentManager
TheCommentManager
provides facilities to manage (create, get or remove)CommentCollection
s. This manager is registered as an OSGi-service and can be obtained via this interface class from the service registry. The manager produces typed collections. The type-specific collections are produced byCommentingProvider
s. The manager binds available factories and uses them to instantiate collections based on the given collection type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <C extends CommentCollection>
CcreateCollection(Resource target, java.lang.Class<C> collectionType)
Create aCommentCollection
for the giventarget
.<C extends CommentCollection>
CgetCollection(Resource target, java.lang.Class<C> collectionType)
Retrieve aCommentCollection
for the giventarget
.<C extends CommentCollection>
CgetOrCreateCollection(Resource target, java.lang.Class<C> collectionType)
Retrieve or - if none exists - create aCommentCollection
for the giventarget
.
-
-
-
Method Detail
-
getCollection
<C extends CommentCollection> C getCollection(Resource target, java.lang.Class<C> collectionType)
Retrieve aCommentCollection
for the giventarget
. The collection is instantiated using the givencollectionType
, as provided by the type-specificCommentingProvider
.- Type Parameters:
C
- A collection type, extendingCommentCollection
.- Parameters:
target
- TheResource
representing the target for which to retrieve the comment collection.collectionType
- The desired type of the collection.- Returns:
- The collection, or
null
if no collection of the requested type is present. - Throws:
CommentException
- If noCommentingProvider
could be found for the givencollectionType
.java.lang.IllegalArgumentException
- If either target or collectionType is null.
-
getOrCreateCollection
<C extends CommentCollection> C getOrCreateCollection(Resource target, java.lang.Class<C> collectionType)
Retrieve or - if none exists - create aCommentCollection
for the giventarget
. The collection is instantiated using the givencollectionType
, as provided by the type-specificCommentingProvider
.- Type Parameters:
C
- A collection type, extendingCommentCollection
.- Parameters:
target
- TheResource
representing the target for which to create or retrieve the comment collection.collectionType
- The desired type of the collection.- Returns:
- The collection.
- Throws:
CommentException
- Upon encountering an error during creation of a collection, or if the collection already exists, or if noCommentingProvider
could be found for the givencollectionType
.java.lang.IllegalArgumentException
- If either target or collectionType is null.
-
createCollection
<C extends CommentCollection> C createCollection(Resource target, java.lang.Class<C> collectionType)
Create aCommentCollection
for the giventarget
. The collection is instantiated using the givencollectionType
, as provided by the type-specificCommentingProvider
.- Type Parameters:
C
- A collection type, extendingCommentCollection
.- Parameters:
target
- TheResource
representing the target for which to create the comment collection.collectionType
- The desired type of the collection.- Returns:
- The newly created collection.
- Throws:
CommentException
- Upon encountering an error during creation of a collection, or if the collection already exists, or if noCommentingProvider
could be found for the givencollectionType
.java.lang.IllegalArgumentException
- If either target or collectionType is null.
-
-