01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.cocoon.components.search.components;
17:
18: import org.apache.avalon.framework.configuration.ConfigurationException;
19: import org.apache.lucene.analysis.Analyzer;
20:
21: /**
22: * Analyzer Manager Component
23: *
24: * @author Maisonneuve Nicolas
25: */
26:
27: public interface AnalyzerManager {
28:
29: public static final String ROLE = AnalyzerManager.class.getName();
30:
31: /**
32: * Return the analyzer
33: *
34: * @param id
35: * analyzer ID
36: * @return
37: * @see org.apache.lucene.analysis.Analyzer
38: */
39: public Analyzer getAnalyzer(String id)
40: throws ConfigurationException;
41:
42: /**
43: * Is this analyzer exist
44: *
45: * @param id
46: * String the analyzer id
47: * @return boolean
48: */
49: public boolean exist(String id);
50:
51: /**
52: * Return all analyzer IDs
53: *
54: * @return A array with all id's analyzer
55: */
56: public String[] getAnalyzersID();
57:
58: /**
59: * Add a lucene analyser
60: *
61: * @param id
62: * the id of the analyzer
63: * @param analyzer
64: * the analyzer to add
65: */
66: public void put(String id, Analyzer analyzer);
67:
68: /**
69: * Remove a analyzer
70: *
71: * @param id
72: * the analyzer ID
73: */
74: public void remove(String id);
75: }
|