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
ReportGeneratorServicewill select a collection of those plugins and apply them on a source object. Each result will be put into aMapunder the correspondingENTRY_NAME_PROPERTYproperty value. This finalMapwill constitute a report of the source object. Plugins will be selected thanks to theirSOURCE_CLASS_PROPERTYand optionally by any provided properties.Implementers: Implementers must define the
ENTRY_NAME_PROPERTYand theSOURCE_CLASS_PROPERTY
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringENTRY_NAME_PROPERTYThe entry name property under which the DTO value extracted by theextract(Object, Locale)method is added to a report.static java.lang.StringSOURCE_CLASS_PROPERTYThe class name of the source object that aReportEntryPlugincan extract.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Objectextract(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 aReportEntryPlugincan 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 benulllocale- theStringrepresentation of aLocale, must not benull- Returns:
- a DTO representation or
nullif 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
-
-