Class AnnotatedIndexDefinitionProcessor
java.lang.Object
io.jmix.search.index.mapping.processor.impl.AnnotatedIndexDefinitionProcessor
@Component("search_AnnotatedIndexDefinitionProcessor")
public class AnnotatedIndexDefinitionProcessor
extends Object
Provides functionality to process index definition interfaces marked with
JmixEntitySearchIndex
-
Field Summary
Modifier and TypeFieldDescriptionprotected final FieldMappingStrategyProvider
protected final IndexAnalysisElementsRegistry
protected final List<IndexSettingsConfigurer>
protected final InstanceNameProvider
protected final MappingFieldAnnotationProcessorsRegistry
protected final Metadata
protected final MetadataTools
protected final MethodArgumentsProvider
protected final PropertyTools
protected final PropertyValueExtractorProvider
protected final SearchProperties
-
Constructor Summary
ConstructorDescriptionAnnotatedIndexDefinitionProcessor
(Metadata metadata, MetadataTools metadataTools, MappingFieldAnnotationProcessorsRegistry mappingFieldAnnotationProcessorsRegistry, PropertyTools propertyTools, FieldMappingStrategyProvider fieldMappingStrategyProvider, InstanceNameProvider instanceNameProvider, PropertyValueExtractorProvider propertyValueExtractorProvider, SearchProperties searchProperties, List<IndexSettingsConfigurer> indexSettingsConfigurers, ContextArgumentResolverComposite resolvers, IndexAnalysisElementsRegistry indexAnalysisElementsRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> T
callMethod
(Class<?> ownerClass, Method method) protected void
configureAnalysisSettings
(org.elasticsearch.common.settings.Settings.Builder settingsBuilder, IndexMappingConfiguration mappingConfiguration) protected void
configureIndexSettings
(org.elasticsearch.common.settings.Settings.Builder settingsBuilder, Class<?> entityClass) protected org.elasticsearch.common.settings.Settings
configureSettings
(Class<?> entityClass, IndexMappingConfiguration mappingConfiguration) protected Object
createClassProxyInstance
(Class<?> ownerClass) protected DisplayedNameDescriptor
createDisplayedNameDescriptor
(MetaClass metaClass) createIndexablePredicate
(io.jmix.search.index.mapping.processor.impl.AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parsedIndexDefinition) createIndexConfiguration
(String className) Processes index definition interface marked withJmixEntitySearchIndex
annotation and createsIndexConfiguration
based on it.protected IndexMappingConfiguration
createIndexMappingConfig
(io.jmix.search.index.mapping.processor.impl.AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parsedIndexDefinition) protected String
createIndexName
(io.jmix.search.index.mapping.processor.impl.AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parsedIndexDefinition) protected Object
createInterfaceProxyInstance
(Class<?> ownerClass) protected Optional<MappingFieldDescriptor>
createMappingFieldDescriptor
(MetaPropertyPath propertyPath, MappingDefinitionElement element) protected Object
createProxy
(Class<?> ownerClass) protected Map<String,
MetaPropertyPath> expandEmbeddedProperties
(MetaClass rootEntityMetaClass, Map<String, MetaPropertyPath> propertyPaths) getAffectedEntityClasses
(IndexMappingConfiguration indexMappingConfiguration) protected Object
invokeProxyMethod
(Class<?> ownerClass, Object proxy, Method method, Object[] args) protected boolean
isFieldMappingAnnotation
(Annotation annotation) protected boolean
isIndexablePredicateMethod
(Method method) protected boolean
protected io.jmix.search.index.mapping.processor.impl.AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition
parseIndexDefinition
(Class<?> indexDefinitionClass) protected void
processAnnotation
(MappingDefinition.MappingDefinitionBuilder builder, Annotation annotation, MetaClass entityMetaClass) protected Map<String,
MappingFieldDescriptor> processMappingDefinition
(MetaClass metaClass, MappingDefinition mappingDefinition) protected List<MappingFieldDescriptor>
processMappingDefinitionElement
(MetaClass metaClass, MappingDefinitionElement element) protected Class<?>
resolveClass
(String className) protected FieldConfiguration
resolveEffectiveFieldConfiguration
(FieldConfiguration strategyFieldConfiguration, FieldConfiguration explicitFieldConfiguration) protected Map<String,
MetaPropertyPath> resolveEffectiveProperties
(MetaClass rootEntityMetaClass, String[] includes, String[] excludes) protected Optional<FieldMappingStrategy>
protected List<MetaPropertyPath>
resolveInstanceNameRelatedProperties
(MetaClass metaClass, MetaPropertyPath rootPropertyPath) protected List<MetaPropertyPath>
resolveInstanceNameRelatedProperties
(MetaPropertyPath propertyPath)
-
Field Details
-
metadata
-
metadataTools
-
mappingFieldAnnotationProcessorsRegistry
-
propertyTools
-
fieldMappingStrategyProvider
-
instanceNameProvider
-
propertyValueExtractorProvider
-
searchProperties
-
indexSettingsConfigurers
-
methodArgumentsProvider
-
indexAnalysisElementsRegistry
-
-
Constructor Details
-
AnnotatedIndexDefinitionProcessor
@Autowired public AnnotatedIndexDefinitionProcessor(Metadata metadata, MetadataTools metadataTools, MappingFieldAnnotationProcessorsRegistry mappingFieldAnnotationProcessorsRegistry, PropertyTools propertyTools, FieldMappingStrategyProvider fieldMappingStrategyProvider, InstanceNameProvider instanceNameProvider, PropertyValueExtractorProvider propertyValueExtractorProvider, SearchProperties searchProperties, List<IndexSettingsConfigurer> indexSettingsConfigurers, ContextArgumentResolverComposite resolvers, IndexAnalysisElementsRegistry indexAnalysisElementsRegistry)
-
-
Method Details
-
createIndexConfiguration
Processes index definition interface marked withJmixEntitySearchIndex
annotation and createsIndexConfiguration
based on it.- Parameters:
className
- full name of index definition interface- Returns:
IndexConfiguration
-
resolveClass
-
parseIndexDefinition
protected io.jmix.search.index.mapping.processor.impl.AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parseIndexDefinition(Class<?> indexDefinitionClass) -
createIndexName
protected String createIndexName(io.jmix.search.index.mapping.processor.impl.AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parsedIndexDefinition) -
createIndexMappingConfig
protected IndexMappingConfiguration createIndexMappingConfig(io.jmix.search.index.mapping.processor.impl.AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parsedIndexDefinition) -
isIndexablePredicateMethod
-
isMappingDefinitionImplementationMethod
-
isFieldMappingAnnotation
-
createIndexablePredicate
-
callMethod
- Throws:
Exception
-
createProxy
-
createInterfaceProxyInstance
-
createClassProxyInstance
-
invokeProxyMethod
-
processAnnotation
protected void processAnnotation(MappingDefinition.MappingDefinitionBuilder builder, Annotation annotation, MetaClass entityMetaClass) -
getAffectedEntityClasses
protected Set<Class<?>> getAffectedEntityClasses(IndexMappingConfiguration indexMappingConfiguration) -
configureSettings
protected org.elasticsearch.common.settings.Settings configureSettings(Class<?> entityClass, IndexMappingConfiguration mappingConfiguration) -
configureAnalysisSettings
protected void configureAnalysisSettings(org.elasticsearch.common.settings.Settings.Builder settingsBuilder, IndexMappingConfiguration mappingConfiguration) -
configureIndexSettings
protected void configureIndexSettings(org.elasticsearch.common.settings.Settings.Builder settingsBuilder, Class<?> entityClass) -
processMappingDefinition
protected Map<String,MappingFieldDescriptor> processMappingDefinition(MetaClass metaClass, MappingDefinition mappingDefinition) -
processMappingDefinitionElement
protected List<MappingFieldDescriptor> processMappingDefinitionElement(MetaClass metaClass, MappingDefinitionElement element) -
resolveEffectiveProperties
-
expandEmbeddedProperties
protected Map<String,MetaPropertyPath> expandEmbeddedProperties(MetaClass rootEntityMetaClass, Map<String, MetaPropertyPath> propertyPaths) -
createMappingFieldDescriptor
protected Optional<MappingFieldDescriptor> createMappingFieldDescriptor(MetaPropertyPath propertyPath, MappingDefinitionElement element) -
resolveEffectiveFieldConfiguration
protected FieldConfiguration resolveEffectiveFieldConfiguration(@Nullable FieldConfiguration strategyFieldConfiguration, @Nullable FieldConfiguration explicitFieldConfiguration) -
createDisplayedNameDescriptor
-
resolveInstanceNameRelatedProperties
protected List<MetaPropertyPath> resolveInstanceNameRelatedProperties(MetaPropertyPath propertyPath) -
resolveInstanceNameRelatedProperties
protected List<MetaPropertyPath> resolveInstanceNameRelatedProperties(MetaClass metaClass, @Nullable MetaPropertyPath rootPropertyPath) -
resolveFieldMappingStrategy
protected Optional<FieldMappingStrategy> resolveFieldMappingStrategy(MappingDefinitionElement element)
-