org.hibernate.search.impl
Class ConfigContext

java.lang.Object
  extended by org.hibernate.search.impl.ConfigContext

public final class ConfigContext
extends Object

Provides access to some default configuration settings (eg default Analyzer or default Similarity) and checks whether certain optional libraries are available.

Author:
Emmanuel Bernard, Hardy Ferentschik

Constructor Summary
ConfigContext(SearchConfiguration cfg)
           
ConfigContext(SearchConfiguration cfg, SearchMapping searchMapping)
           
 
Method Summary
 void addAnalyzerDef(AnalyzerDef analyzerDef, org.hibernate.annotations.common.reflection.XAnnotatedElement annotatedElement)
          Add an analyzer definition which was defined as annotation.
 void addGlobalAnalyzerDef(AnalyzerDef analyzerDef)
           
 org.apache.lucene.analysis.Analyzer buildLazyAnalyzer(String name)
           
 Map<FieldBridge,ClassBridge> getClassBridgeInstances(Class<?> type)
          Returns class bridge instances configured via the programmatic API, if any.
 org.apache.lucene.analysis.Analyzer getDefaultAnalyzer()
           
 String getDefaultNullToken()
           
 org.apache.lucene.util.Version getLuceneMatchVersion()
           
 Map<String,org.apache.lucene.analysis.Analyzer> initLazyAnalyzers()
           
 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 cfg)

ConfigContext

public ConfigContext(SearchConfiguration cfg,
                     SearchMapping searchMapping)
Method Detail

addAnalyzerDef

public void addAnalyzerDef(AnalyzerDef analyzerDef,
                           org.hibernate.annotations.common.reflection.XAnnotatedElement annotatedElement)
Add an analyzer definition which was defined as annotation.

Parameters:
analyzerDef - the analyzer definition annotation
annotatedElement - the annotated element it was defined on

addGlobalAnalyzerDef

public void addGlobalAnalyzerDef(AnalyzerDef analyzerDef)

buildLazyAnalyzer

public org.apache.lucene.analysis.Analyzer buildLazyAnalyzer(String name)

getDefaultNullToken

public String getDefaultNullToken()

getDefaultAnalyzer

public org.apache.lucene.analysis.Analyzer getDefaultAnalyzer()

getLuceneMatchVersion

public org.apache.lucene.util.Version getLuceneMatchVersion()

initLazyAnalyzers

public Map<String,org.apache.lucene.analysis.Analyzer> initLazyAnalyzers()

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–2013 Hibernate. All rights reserved.