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
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected final FieldMappingStrategyProvider
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, ContextArgumentResolverComposite resolvers) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> T
callMethod
(Class<?> ownerClass, Method method) protected Object
createClassProxyInstance
(Class<?> ownerClass) protected DisplayedNameDescriptor
createDisplayedNameDescriptor
(MetaClass metaClass) protected ExtendedSearchSettings
createExtendedSearchSettings
(Class<?> indexDefinitionClass) createIndexablePredicate
(AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parsedIndexDefinition) createIndexConfiguration
(String className) Processes index definition interface marked withJmixEntitySearchIndex
annotation and createsIndexConfiguration
based on it.protected IndexMappingConfiguration
createIndexMappingConfig
(AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parsedIndexDefinition) protected String
createIndexName
(AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parsedIndexDefinition) protected Object
createInterfaceProxyInstance
(Class<?> ownerClass) protected Optional<MappingFieldDescriptor>
createMappingFieldDescriptor
(MetaPropertyPath propertyPath, MappingDefinitionElement element, ExtendedSearchSettings extendedSearchSettings) 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
parseIndexDefinition
(Class<?> indexDefinitionClass) protected void
processAnnotation
(MappingDefinition.MappingDefinitionBuilder builder, Annotation annotation, MetaClass entityMetaClass) protected Map<String,
MappingFieldDescriptor> processMappingDefinition
(MetaClass metaClass, MappingDefinition mappingDefinition, ExtendedSearchSettings extendedSearchSettings) protected List<MappingFieldDescriptor>
processMappingDefinitionElement
(MetaClass metaClass, MappingDefinitionElement element, ExtendedSearchSettings extendedSearchSettings) 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
-
methodArgumentsProvider
-
-
Constructor Details
-
AnnotatedIndexDefinitionProcessor
@Autowired public AnnotatedIndexDefinitionProcessor(Metadata metadata, MetadataTools metadataTools, MappingFieldAnnotationProcessorsRegistry mappingFieldAnnotationProcessorsRegistry, PropertyTools propertyTools, FieldMappingStrategyProvider fieldMappingStrategyProvider, InstanceNameProvider instanceNameProvider, PropertyValueExtractorProvider propertyValueExtractorProvider, SearchProperties searchProperties, ContextArgumentResolverComposite resolvers)
-
-
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 AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parseIndexDefinition(Class<?> indexDefinitionClass) -
createIndexName
protected String createIndexName(AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parsedIndexDefinition) -
createExtendedSearchSettings
-
createIndexMappingConfig
protected IndexMappingConfiguration createIndexMappingConfig(AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parsedIndexDefinition) -
isIndexablePredicateMethod
-
isMappingDefinitionImplementationMethod
-
isFieldMappingAnnotation
-
createIndexablePredicate
protected Predicate<Object> createIndexablePredicate(AnnotatedIndexDefinitionProcessor.ParsedIndexDefinition parsedIndexDefinition) -
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) -
processMappingDefinition
protected Map<String,MappingFieldDescriptor> processMappingDefinition(MetaClass metaClass, MappingDefinition mappingDefinition, ExtendedSearchSettings extendedSearchSettings) -
processMappingDefinitionElement
protected List<MappingFieldDescriptor> processMappingDefinitionElement(MetaClass metaClass, MappingDefinitionElement element, ExtendedSearchSettings extendedSearchSettings) -
resolveEffectiveProperties
-
expandEmbeddedProperties
protected Map<String,MetaPropertyPath> expandEmbeddedProperties(MetaClass rootEntityMetaClass, Map<String, MetaPropertyPath> propertyPaths) -
createMappingFieldDescriptor
protected Optional<MappingFieldDescriptor> createMappingFieldDescriptor(MetaPropertyPath propertyPath, MappingDefinitionElement element, ExtendedSearchSettings extendedSearchSettings) -
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)
-