Interface AdditionalPropertyResolver

  • All Superinterfaces:
    Prioritizable
    All Known Implementing Classes:
    RelevantCharacteristicAdditionalPropertyResolver

    public interface AdditionalPropertyResolver
    extends Prioritizable
    An extension mechanism that allows to define a custom way for resolving additional properties which cannot be resolved through the data model. This interface mainly allows to retrieve the value of the additional property and to provide the data source properties required to filter and sort in the client side by the property field linked to the additional property.
    • Method Detail

      • canResolve

        boolean canResolve​(Entity entity,
                           String additionalProperty)
        Determines if the value of the given property can be resolved for the business objects of the given entity.
        Parameters:
        entity - The entity that may be linked to the given property, although without having direct relationship through the data model
        additionalProperty - The additional property path
        Returns:
        true if the value of the property can be resolved with this AdditionalPropertyResolver or in any other case
      • getDataSourceProperties

        List<DataSourceProperty> getDataSourceProperties​(Entity entity,
                                                         String additionalProperty)
        Provides the list of DataSourceProperty that must be included in the standard data sources when the provided entity and additional property are requested. This is needed in order to support filtering and sorting in the client side by the given additional property. If null or an empty list is returned, then the properties will be tried to be retrieved with an AdditionalPropertyResolver with less priority, if any. If there is no AdditionalPropertyResolver returning a list with properties, then no data source properties will be added for the given additional property.
        Parameters:
        entity - The base entity
        additionalProperty - The additional property path
        Returns:
        the list of DataSourceProperty to be included in the data source
        See Also:
        DefaultDataSourceService.getDataSourceProperties(java.util.Map<java.lang.String, java.lang.Object>)
      • getPropertyNames

        Set<String> getPropertyNames​(Entity entity)
        Retrieves the set of names of the additional properties that can be resolved with this AdditionalPropertyResolver for the given Entity. It is used to display these names as part of the list of available properties calculated by the ModelDataSourceService.
        Parameters:
        entity - The entity whose additional properties would be resolved
        Returns:
        the set of names of the additional properties that can be resolved for the given entity with this AdditionalPropertyResolver
        See Also:
        ModelDataSourceService.fetch(java.util.Map<java.lang.String, java.lang.String>)