org.hibernate.search.engine.impl

## Class ConfigContext

- java.lang.Object
- - org.hibernate.search.engine.impl.ConfigContext

-     public final class ConfigContext
      extends Object

  Provides access to some default configuration settings (eg is JPA present, what is the default null token) and holds mapping-scoped configuration (such as analyzer definitions).
  Author:
    Emmanuel Bernard, Hardy Ferentschik

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigContext(SearchConfiguration searchConfiguration, BuildContext buildContext)`
    `ConfigContext(SearchConfiguration searchConfiguration, BuildContext buildContext, SearchMapping searchMapping, Map<IndexManagerType,SearchIntegration> previousSearchIntegrations)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SearchIntegrationConfigContext` | `forType(IndexManagerType type)`
    `MappingDefinitionRegistry<AnalyzerDef,?>` | `getAnalyzerDefinitionRegistry()`
    `Map<FieldBridge,ClassBridge>` | `getClassBridgeInstances(Class<?> type)` Returns class bridge instances configured via the programmatic API, if any.
    `String` | `getDefaultNullToken()`
    `MappingDefinitionRegistry<FullTextFilterDef,?>` | `getFullTextFilterDefinitionRegistry()`
    `MappingDefinitionRegistry<NormalizerDef,?>` | `getNormalizerDefinitionRegistry()`
    `ServiceManager` | `getServiceManager()`
    `Map<String,FilterDef>` | `initFilters()`
    `Map<IndexManagerType,SearchIntegration>` | `initIntegrations(IndexManagerHolder indexesFactory)` Initialize integrations for all discovered index manager types.
    `boolean` | `isJpaPresent()`
    `boolean` | `isProvidedIdImplicit()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConfigContext

          public ConfigContext(SearchConfiguration searchConfiguration,
                               BuildContext buildContext)

    - #### ConfigContext

          public ConfigContext(SearchConfiguration searchConfiguration,
                               BuildContext buildContext,
                               SearchMapping searchMapping,
                               Map<IndexManagerType,SearchIntegration> previousSearchIntegrations)

  - ### Method Detail

    - #### getServiceManager

          public ServiceManager getServiceManager()

    - #### getAnalyzerDefinitionRegistry

          public MappingDefinitionRegistry<AnalyzerDef,?> getAnalyzerDefinitionRegistry()

    - #### getNormalizerDefinitionRegistry

          public MappingDefinitionRegistry<NormalizerDef,?> getNormalizerDefinitionRegistry()

    - #### getFullTextFilterDefinitionRegistry

          public MappingDefinitionRegistry<FullTextFilterDef,?> getFullTextFilterDefinitionRegistry()

    - #### forType

          public SearchIntegrationConfigContext forType(IndexManagerType type)

    - #### getDefaultNullToken

          public String getDefaultNullToken()

    - #### initIntegrations

          public Map<IndexManagerType,SearchIntegration> initIntegrations(IndexManagerHolder indexesFactory)

      Initialize integrations for all discovered index manager types. In particular, initialize the named analyzer references created throughout the mapping creation with the analyzer definitions collected throughout the mapping creation.

      Analyzer definitions and references are handled simultaneously during the mapping creation, so it's actually possible that, while creating the mapping, we encounter references to analyzer which haven't been defined yet.

      To work around this issue, we do not resolve references immediately, but instead create "dangling" references whose initialization will be delayed to the end of the mapping (see `SearchIntegrationConfigContext.getAnalyzerRegistry()`).

      This method executes the final initialization, resolving dangling references.

      Parameters:
        `indexesFactory` - The index manager holder, giving access to the relevant index manager types.
      Returns:
        The initialized (and immutable) search integrations.

    - #### initFilters

          public Map<String,FilterDef> initFilters()

    - #### isJpaPresent

          public boolean isJpaPresent()

    - #### isProvidedIdImplicit

          public boolean isProvidedIdImplicit()

      Returns:
        true if we have to assume entities are annotated with @ProvidedId implicitly

    - #### getClassBridgeInstances

          public Map<FieldBridge,ClassBridge> getClassBridgeInstances(Class<?> type)

      Returns class bridge instances configured via the programmatic API, if any. The returned map's values are `@ClassBridge` annotations representing the corresponding analyzer etc. configuration.
      Parameters:
        `type` - the type for which to return the configured class bridge instances
      Returns:
        a map with class bridge instances and their configuration; May be empty but never `null`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved