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 aMap
under the correspondingENTRY_NAME_PROPERTY
property value. This finalMap
will constitute a report of the source object. Plugins will be selected thanks to theirSOURCE_CLASS_PROPERTY
and optionally by any provided properties.Implementers: Implementers must define the
ENTRY_NAME_PROPERTY
and theSOURCE_CLASS_PROPERTY
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ENTRY_NAME_PROPERTY
The entry name property under which the DTO value extracted by theextract(Object, Locale)
method is added to a report.static java.lang.String
SOURCE_CLASS_PROPERTY
The class name of the source object that aReportEntryPlugin
can extract.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
extract(T source, java.util.Locale locale)
Extracts a piece of information from the source in arguments.java.util.Map<java.lang.String,java.lang.String>
getProperties()
-
-
-
Field Detail
-
ENTRY_NAME_PROPERTY
static final java.lang.String 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:
- Constant Field Values
-
SOURCE_CLASS_PROPERTY
static final java.lang.String SOURCE_CLASS_PROPERTY
The class name of the source object that aReportEntryPlugin
can extract.- See Also:
- Constant Field Values
-
-
Method Detail
-
extract
java.lang.Object extract(T source, java.util.Locale locale) throws java.lang.Exception
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:
java.lang.Exception
-
getProperties
java.util.Map<java.lang.String,java.lang.String> getProperties()
- Returns:
- a map of properties, never
null
-
-