Class AbstractPropertyValueExtractor

java.lang.Object
io.jmix.search.index.mapping.propertyvalue.impl.AbstractPropertyValueExtractor
All Implemented Interfaces:
PropertyValueExtractor
Direct Known Subclasses:
EnumPropertyValueExtractor, FilePropertyValueExtractor, ReferencePropertyValueExtractor, SimplePropertyValueExtractor

public abstract class AbstractPropertyValueExtractor extends Object implements PropertyValueExtractor
Base class for PropertyValueExtractor implementations.
  • Field Details

    • objectMapper

      protected static final com.fasterxml.jackson.databind.ObjectMapper objectMapper
  • Constructor Details

    • AbstractPropertyValueExtractor

      public AbstractPropertyValueExtractor()
  • Method Details

    • getValue

      public com.fasterxml.jackson.databind.JsonNode getValue(Object entity, MetaPropertyPath propertyPath, Map<String,Object> parameters)
      Description copied from interface: PropertyValueExtractor
      Extracts value from entity instance.
      Specified by:
      getValue in interface PropertyValueExtractor
      Parameters:
      entity - instance
      propertyPath - property
      parameters - runtime parameters
      Returns:
      extracted value as json
    • isSupported

      protected abstract boolean isSupported(Object entity, MetaPropertyPath propertyPath, Map<String,Object> parameters)
      Checks if this value mapper supports value extraction of provided property.
      Parameters:
      entity - instance
      propertyPath - property
      parameters - parameters
      Returns:
      true if value mapper supports this property, false otherwise
    • transformSingleValue

      protected abstract com.fasterxml.jackson.databind.JsonNode transformSingleValue(Object value, Map<String,Object> parameters)
      Transform extracted value of single-value property into result json.
      Parameters:
      value - value of single-value property
      parameters - parameters
      Returns:
      value as json
    • transformMultipleValues

      protected abstract com.fasterxml.jackson.databind.JsonNode transformMultipleValues(Iterable<?> values, Map<String,Object> parameters)
      Transform extracted value of multi-value property into result json.
      Parameters:
      values - values of multi-value property
      parameters - parameters
      Returns:
      value as json
    • isCollection

      protected boolean isCollection(Object value)
    • processValue

      protected com.fasterxml.jackson.databind.JsonNode processValue(Object value, Map<String,Object> parameters)
    • getFlatValueOrNull

      @Nullable protected Object getFlatValueOrNull(Object entity, MetaPropertyPath propertyPath, Map<String,Object> parameters)