Package com.adobe.granite.comments
Interface CommentManager
-
@ProviderType public interface CommentManager
TheCommentManagerprovides facilities to manage (create, get or remove)CommentCollections. 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 byCommentingProviders. 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 aCommentCollectionfor the giventarget.<C extends CommentCollection>
CgetCollection(Resource target, java.lang.Class<C> collectionType)Retrieve aCommentCollectionfor the giventarget.<C extends CommentCollection>
CgetOrCreateCollection(Resource target, java.lang.Class<C> collectionType)Retrieve or - if none exists - create aCommentCollectionfor the giventarget.
-
-
-
Method Detail
-
getCollection
<C extends CommentCollection> C getCollection(Resource target, java.lang.Class<C> collectionType)
Retrieve aCommentCollectionfor the giventarget. The collection is instantiated using the givencollectionType, as provided by the type-specificCommentingProvider.- Type Parameters:
C- A collection type, extendingCommentCollection.- Parameters:
target- TheResourcerepresenting the target for which to retrieve the comment collection.collectionType- The desired type of the collection.- Returns:
- The collection, or
nullif no collection of the requested type is present. - Throws:
CommentException- If noCommentingProvidercould 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 aCommentCollectionfor the giventarget. The collection is instantiated using the givencollectionType, as provided by the type-specificCommentingProvider.- Type Parameters:
C- A collection type, extendingCommentCollection.- Parameters:
target- TheResourcerepresenting 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 noCommentingProvidercould 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 aCommentCollectionfor the giventarget. The collection is instantiated using the givencollectionType, as provided by the type-specificCommentingProvider.- Type Parameters:
C- A collection type, extendingCommentCollection.- Parameters:
target- TheResourcerepresenting 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 noCommentingProvidercould be found for the givencollectionType.java.lang.IllegalArgumentException- If either target or collectionType is null.
-
-