org.apache.cocoon.components.search.components.impl
Class AnalyzerManagerImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.search.components.impl.AnalyzerManagerImpl
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.thread.ThreadSafe, AnalyzerManager

public class AnalyzerManagerImpl
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements AnalyzerManager, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.thread.ThreadSafe

Implementation of the Analyzer Component

Version:
1.0
Author:
Maisonneuve Nicolas

Field Summary
static java.lang.String ANALYZER_ELEMENT
          The analyzer element
static java.lang.String CLASSNAME_ATT
          the analyzer class name
static java.lang.String CONFIG_ATT
          (optional) a file to configure the analyzer
static java.lang.String CONFIGCHECK_ATT
          Automatic update or not the analyzer when the config file changes
static java.lang.String ID_ATT
          the id of the analyzer
 
Fields inherited from interface org.apache.cocoon.components.search.components.AnalyzerManager
ROLE
 
Constructor Summary
AnalyzerManagerImpl()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 boolean exist(java.lang.String id)
          Is this analyzer exist
 org.apache.lucene.analysis.Analyzer getAnalyzer(java.lang.String id)
          Return the analyzer
 java.lang.String[] getAnalyzersID()
          Return all analyzer IDs
 void put(java.lang.String id, org.apache.lucene.analysis.Analyzer analyzer)
          Add a lucene analyser
 void remove(java.lang.String id)
          Remove a analyzer
 void service(org.apache.avalon.framework.service.ServiceManager manager)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANALYZER_ELEMENT

public static final java.lang.String ANALYZER_ELEMENT
The analyzer element

See Also:
Constant Field Values

ID_ATT

public static final java.lang.String ID_ATT
the id of the analyzer

See Also:
Constant Field Values

CLASSNAME_ATT

public static final java.lang.String CLASSNAME_ATT
the analyzer class name

See Also:
Constant Field Values

CONFIG_ATT

public static final java.lang.String CONFIG_ATT
(optional) a file to configure the analyzer

See Also:
Constant Field Values

CONFIGCHECK_ATT

public static final java.lang.String CONFIGCHECK_ATT
Automatic update or not the analyzer when the config file changes

See Also:
Constant Field Values
Constructor Detail

AnalyzerManagerImpl

public AnalyzerManagerImpl()
Method Detail

exist

public boolean exist(java.lang.String id)
Description copied from interface: AnalyzerManager
Is this analyzer exist

Specified by:
exist in interface AnalyzerManager
Parameters:
id - String the analyzer id
Returns:
boolean

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

put

public void put(java.lang.String id,
                org.apache.lucene.analysis.Analyzer analyzer)
Description copied from interface: AnalyzerManager
Add a lucene analyser

Specified by:
put in interface AnalyzerManager
Parameters:
id - the id of the analyzer
analyzer - the analyzer to add

remove

public void remove(java.lang.String id)
Description copied from interface: AnalyzerManager
Remove a analyzer

Specified by:
remove in interface AnalyzerManager
Parameters:
id - the analyzer ID

getAnalyzersID

public java.lang.String[] getAnalyzersID()
Description copied from interface: AnalyzerManager
Return all analyzer IDs

Specified by:
getAnalyzersID in interface AnalyzerManager
Returns:
A array with all id's analyzer

getAnalyzer

public org.apache.lucene.analysis.Analyzer getAnalyzer(java.lang.String id)
                                                throws org.apache.avalon.framework.configuration.ConfigurationException
Description copied from interface: AnalyzerManager
Return the analyzer

Specified by:
getAnalyzer in interface AnalyzerManager
Parameters:
id - analyzer ID
Returns:
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Analyzer

service

public void service(org.apache.avalon.framework.service.ServiceManager manager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException


Copyright $ Apache Software Foundation. All Rights Reserved.