Package aQute.bnd.service.reporter
Interface ReportEntryPlugin<T>
@ProviderType
public interface ReportEntryPlugin<T>
This plugin extracts a piece of information (potentially localized) from a
source object and converts it into a DTO representation.
The ReportGeneratorService
will select a collection of those plugins
and apply them on a source object. Each result will be put into a Map
under the corresponding ENTRY_NAME_PROPERTY
property value. This final Map
will constitute a report of the source
object. Plugins will be selected thanks to their
SOURCE_CLASS_PROPERTY
and optionally by any
provided properties.
Implementers: Implementers must define the
ENTRY_NAME_PROPERTY
and the
SOURCE_CLASS_PROPERTY
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The entry name property under which the DTO value extracted by theextract(Object, Locale)
method is added to a report.static final String
The class name of the source object that aReportEntryPlugin
can extract. -
Method Summary
-
Field Details
-
ENTRY_NAME_PROPERTY
The entry name property under which the DTO value extracted by theextract(Object, Locale)
method is added to a report.- See Also:
-
SOURCE_CLASS_PROPERTY
The class name of the source object that aReportEntryPlugin
can extract.- See Also:
-
-
Method Details
-
extract
Extracts a piece of information from the source in arguments.If the source contains localized data, it will be extracted for the specified locale or a less specific if not found.
- Parameters:
source
- the source to inspect, must not benull
locale
- theString
representation of aLocale
, must not benull
- Returns:
- a DTO representation or
null
if no data is available - Throws:
Exception
-
getProperties
- Returns:
- a map of properties, never
null
-