Class AutoMappingStrategy
java.lang.Object
io.jmix.search.index.mapping.strategy.impl.AutoMappingStrategy
- All Implemented Interfaces:
FieldMappingStrategy
@Component("search_AutoMappingStrategy")
public class AutoMappingStrategy
extends Object
implements FieldMappingStrategy
Strategy that automatically maps properties the most common way.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FieldMapperProviderprotected final PropertyValueExtractorProvider -
Constructor Summary
ConstructorsConstructorDescriptionAutoMappingStrategy(PropertyValueExtractorProvider propertyValueExtractorProvider, FieldMapperProvider fieldMapperProvider) -
Method Summary
Modifier and TypeMethodDescriptioncreateFieldConfiguration(MetaPropertyPath propertyPath, Map<String, Object> parameters) Creates field configuration as native json.createFieldConfiguration(MetaPropertyPath propertyPath, Map<String, Object> parameters, ExtendedSearchSettings extendedSearchSettings) intgetOrder()Defines the order of mapping strategy.getPropertyValueExtractor(MetaPropertyPath propertyPath) ProvidesPropertyValueExtractorto extract property value from entity instancesprotected booleanhasFieldMapper(MetaPropertyPath propertyPath) protected booleanhasPropertyValueExtractor(MetaPropertyPath propertyPath) booleanisSupported(MetaPropertyPath propertyPath) Checks is providedMetaPropertyPathis supported by this mapping strategyprotected Optional<FieldMapper>resolveFieldMapper(MetaPropertyPath propertyPath) protected Optional<PropertyValueExtractor>resolvePropertyValueExtractor(MetaPropertyPath propertyPath)
-
Field Details
-
propertyValueExtractorProvider
-
fieldMapperProvider
-
-
Constructor Details
-
AutoMappingStrategy
@Autowired public AutoMappingStrategy(PropertyValueExtractorProvider propertyValueExtractorProvider, FieldMapperProvider fieldMapperProvider)
-
-
Method Details
-
getOrder
public int getOrder()Description copied from interface:FieldMappingStrategyDefines the order of mapping strategy. If several strategies match the same property strategy with the latest order will be used- Specified by:
getOrderin interfaceFieldMappingStrategy- Returns:
- order
-
isSupported
Description copied from interface:FieldMappingStrategyChecks is providedMetaPropertyPathis supported by this mapping strategy- Specified by:
isSupportedin interfaceFieldMappingStrategy- Parameters:
propertyPath- property to check- Returns:
- true if provided
MetaPropertyPathis supported, false otherwise
-
createFieldConfiguration
public FieldConfiguration createFieldConfiguration(MetaPropertyPath propertyPath, Map<String, Object> parameters) Description copied from interface:FieldMappingStrategyCreates field configuration as native json.- Specified by:
createFieldConfigurationin interfaceFieldMappingStrategy- Parameters:
propertyPath- property to generate configuration forparameters- input parameters- Returns:
FieldConfiguration
-
createFieldConfiguration
public FieldConfiguration createFieldConfiguration(MetaPropertyPath propertyPath, Map<String, Object> parameters, ExtendedSearchSettings extendedSearchSettings) - Specified by:
createFieldConfigurationin interfaceFieldMappingStrategy
-
getPropertyValueExtractor
Description copied from interface:FieldMappingStrategyProvidesPropertyValueExtractorto extract property value from entity instances- Specified by:
getPropertyValueExtractorin interfaceFieldMappingStrategy- Parameters:
propertyPath- property- Returns:
PropertyValueExtractor
-
hasFieldMapper
-
hasPropertyValueExtractor
-
resolveFieldMapper
-
resolvePropertyValueExtractor
protected Optional<PropertyValueExtractor> resolvePropertyValueExtractor(MetaPropertyPath propertyPath)
-