Package org.apache.lucene.analysis
Class CharFilterFactory
java.lang.Object
org.apache.lucene.analysis.AbstractAnalysisFactory
org.apache.lucene.analysis.CharFilterFactory
Abstract parent class for analysis factories that create
CharFilter
instances.- Since:
- 3.1
-
Field Summary
Fields inherited from class org.apache.lucene.analysis.AbstractAnalysisFactory
LUCENE_MATCH_VERSION_PARAM, luceneMatchVersion
-
Constructor Summary
ModifierConstructorDescriptionprotected
Default ctor for compatibility with SPIprotected
CharFilterFactory
(Map<String, String> args) Initialize this factory via a set of key-value pairs. -
Method Summary
Modifier and TypeMethodDescriptionreturns a list of all available charfilter namesabstract Reader
Wraps the given Reader with a CharFilter.static String
findSPIName
(Class<? extends CharFilterFactory> serviceClass) looks up a SPI name for the specified char filter factorystatic CharFilterFactory
looks up a charfilter by name from context classpathstatic Class<? extends CharFilterFactory>
lookupClass
(String name) looks up a charfilter class by name from context classpathNormalize the specified input Reader While the default implementation returns input unchanged, char filters that should be applied at normalization time can delegate tocreate
method.static void
reloadCharFilters
(ClassLoader classloader) Reloads the factory list from the givenClassLoader
.Methods inherited from class org.apache.lucene.analysis.AbstractAnalysisFactory
defaultCtorException, get, get, get, get, get, getBoolean, getChar, getClassArg, getFloat, getInt, getLines, getLuceneMatchVersion, getOriginalArgs, getPattern, getSet, getSnowballWordSet, getWordSet, isExplicitLuceneMatchVersion, require, require, require, requireBoolean, requireChar, requireFloat, requireInt, setExplicitLuceneMatchVersion, splitAt, splitFileNames
-
Constructor Details
-
CharFilterFactory
protected CharFilterFactory()Default ctor for compatibility with SPI -
CharFilterFactory
Initialize this factory via a set of key-value pairs.
-
-
Method Details
-
forName
looks up a charfilter by name from context classpath -
lookupClass
looks up a charfilter class by name from context classpath -
availableCharFilters
returns a list of all available charfilter names -
findSPIName
looks up a SPI name for the specified char filter factory -
reloadCharFilters
Reloads the factory list from the givenClassLoader
. Changes to the factories are visible after the method ends, all iterators (availableCharFilters()
,...) stay consistent.NOTE: Only new factories are added, existing ones are never removed or replaced.
This method is expensive and should only be called for discovery of new factories on the given classpath/classloader!
-
create
Wraps the given Reader with a CharFilter. -
normalize
Normalize the specified input Reader While the default implementation returns input unchanged, char filters that should be applied at normalization time can delegate tocreate
method.
-