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

    • 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 be null
        locale - the String representation of a Locale, must not be null
        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