Interface RepresentationGenerator<T>
-
- Type Parameters:
T
- The type for which this representation generator works.
public interface RepresentationGenerator<T>
This type contains functionality to create abstract representations of content items of a given type. Clients can implement this interface for custom content items (e.g., WCB elements) and make it available via the OSGi service registry. AnyRepresentationGeneratorService
then registers it and uses it for generating representations of the custom content items. Note that theContentRepresentations
class contains a number of factory methods for theContentRepresentation
and related types.Implementations must be prepared that the methods of this type can be called in parallel from multiple threads.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Class<T>
getSupportedType()
Returns the supported type at runtime.ContentRepresentation
represent(T contentItem)
Generates a representation of the given content item.
-
-
-
Method Detail
-
getSupportedType
Class<T> getSupportedType()
Returns the supported type at runtime.- Returns:
- the supported type
-
represent
ContentRepresentation represent(T contentItem) throws ContentRepresentationException
Generates a representation of the given content item.- Parameters:
contentItem
- the item of which to generate a representation- Returns:
- an appropriate
ContentRepresentation
- Throws:
ContentRepresentationException
- on error
-
-