|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.gouv.culture.sdx.utils.AbstractSdxObject fr.gouv.culture.sdx.search.lucene.analysis.AnalyzerManager
public class AnalyzerManager
Utility class for managing Lucene analyzers in a multilingual context.
Lucene analyzers are used for indexing and querying a Lucene index. An analyzer is specific to a language, so in a multilingual context we need a way to manage analyzers.
Most SDX applications will share the same analyzers for popular languages and contexts. In order to reuse resources, we will create only one AnalyzerManager and attach it to the framework.
Analyzers used within this manager will each have a unique key. This key will be a combination of the locale and the configuration file used.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface fr.gouv.culture.sdx.utils.SdxObject |
---|
SdxObject.ConfigurationNode |
Field Summary | |
---|---|
static java.lang.String |
CLASS_NAME_SUFFIX
|
Fields inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
---|
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized |
Fields inherited from interface fr.gouv.culture.sdx.utils.Encodable |
---|
DEFAULT_ENCODING |
Constructor Summary | |
---|---|
AnalyzerManager()
Builds a manager. |
Method Summary | |
---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Configures the manager. |
Analyzer |
getAnalyzer(java.util.Locale locale,
java.io.File configurationFile)
Adds an analyzer given a locale and a configuration file. |
Analyzer |
getAnalyzer(java.lang.String className,
java.io.File configurationFile)
Adds an analyzer using a specific class name and a configuration file. |
protected java.lang.String |
getClassNameSuffix()
Sub classes should element this method to return their class name suffix for SAX output |
protected boolean |
initToSax()
Init the LinkedHashMap _xmlizable_objects with the objects in order to describ them in XML |
protected void |
initVolatileObjectsToSax()
Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML Some objects need to be refresh each time a toSAX is called |
Methods inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
---|
configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, toSAX, verifyConfigurationResources |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_NAME_SUFFIX
Constructor Detail |
---|
public AnalyzerManager()
Only one manager is needed for a running SDX installation. It is created and managed by the SDX framework.
Method Detail |
---|
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
For now, no specific configuration is needed.
configure
in interface org.apache.avalon.framework.configuration.Configurable
configure
in class AbstractSdxObject
org.apache.avalon.framework.configuration.ConfigurationException
public Analyzer getAnalyzer(java.util.Locale locale, java.io.File configurationFile) throws SDXException
locale
- The givene locale, cannot be nullconfigurationFile
- An XML file for configuring the analyzer (may be null)
SDXException
public Analyzer getAnalyzer(java.lang.String className, java.io.File configurationFile) throws SDXException
className
- The name of the class to use.configurationFile
- The configuration file for the analyzer (may be null)
SDXException
protected java.lang.String getClassNameSuffix()
AbstractSdxObject
getClassNameSuffix
in class AbstractSdxObject
protected boolean initToSax()
AbstractSdxObject
initToSax
in class AbstractSdxObject
protected void initVolatileObjectsToSax()
initVolatileObjectsToSax
in class AbstractSdxObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |