LUCENE-9281: Retire SPIClassIterator from master because Java 9+ uses different mechanism to load services when module system is used (#1360)

LUCENE-9281: Use java.util.ServiceLoader to load codec components and analysis factories to be compatible with Java Module System
This commit is contained in:
Uwe Schindler 2020-03-25 18:03:36 +01:00 committed by GitHub
parent ad75916b6b
commit 2c7a710945
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
171 changed files with 961 additions and 231 deletions

View File

@ -47,6 +47,13 @@ API Changes
* LUCENE-9264: SimpleFSDirectory has been removed in favor of NIOFSDirectory.
(Yannick Welsch)
* LUCENE-9281: Use java.util.ServiceLoader to load codec components and analysis
factories to be compatible with Java Module System. This allows to load factories
without META-INF/service from a Java module exposing the factory in the module
descriptor. This breaks backwards compatibility as custom analysis factories
must now also implement the default constructor (see MIGRATE.txt).
(Uwe Schindler, Dawid Weiss)
Improvements
* LUCENE-8757: When provided with an ExecutorService to run queries across

View File

@ -37,13 +37,13 @@ longer outputs the original token "株式会社" by default. To output original
explicitly set to false. Be aware that if this option is set to false SynonymFilter or SynonymGraphFilter does not work
correctly (see LUCENE-9173).
## Analysis factories now have customizable symbolic names (LUCENE-8778) ##
## Analysis factories now have customizable symbolic names (LUCENE-8778) and need additional no-arg constructor (LUCENE-9281) ##
The SPI names for concrete subclasses of TokenizerFactory, TokenFilterFactory, and CharfilterFactory are no longer
derived from their class name. Instead, each factory must have a static "NAME" field like this:
/** o.a.l.a.standard.StandardTokenizerFactory's SPI name */
public static final String NAME = "standard";
/** o.a.l.a.standard.StandardTokenizerFactory's SPI name */
public static final String NAME = "standard";
A factory can be resolved/instantiated with its NAME by using methods such as TokenizerFactory#lookupClass(String)
or TokenizerFactory#forName(String, Map<String,String>).
@ -51,6 +51,21 @@ or TokenizerFactory#forName(String, Map<String,String>).
If there are any user-defined factory classes that don't have proper NAME field, an exception will be thrown
when (re)loading factories. e.g., when calling TokenizerFactory#reloadTokenizers(ClassLoader).
In addition starting all factories need to implement a public no-arg constructor, too. The reason for this
change comes from the fact that Lucene now uses `java.util.ServiceLoader` instead its own implementation to
load the factory classes to be compatible with Java Module System changes (e.g., load factories from modules).
In the future, extensions to Lucene developed on the Java Module System may expose the factories from their
`module-info.java` file instead of `META-INF/services`.
This constructor is never called by Lucene, so by default it throws a UnsupportedOperationException. User-defined
factory classes should implement it in the following way:
/** Default ctor for compatibility with SPI */
public StandardTokenizerFactory() {
throw defaultCtorException();
}
(`defaultCtorException()` is a protected static helper method)
## TermsEnum is now fully abstract (LUCENE-8292) ##

View File

@ -48,6 +48,11 @@ public class ArabicNormalizationFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public ArabicNormalizationFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new ArabicNormalizationFilter(input);

View File

@ -49,6 +49,11 @@ public class ArabicStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public ArabicStemFilterFactory() {
throw defaultCtorException();
}
@Override
public ArabicStemFilter create(TokenStream input) {
return new ArabicStemFilter(input);

View File

@ -48,6 +48,11 @@ public class BulgarianStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public BulgarianStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new BulgarianStemFilter(input);

View File

@ -46,6 +46,11 @@ public class BengaliNormalizationFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public BengaliNormalizationFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new BengaliNormalizationFilter(input);

View File

@ -46,6 +46,11 @@ public class BengaliStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public BengaliStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new BengaliStemFilter(input);

View File

@ -55,6 +55,11 @@ public class DelimitedBoostTokenFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public DelimitedBoostTokenFilterFactory() {
throw defaultCtorException();
}
@Override
public DelimitedBoostTokenFilter create(TokenStream input) {
return new DelimitedBoostTokenFilter(input, delimiter);

View File

@ -49,6 +49,11 @@ public class BrazilianStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public BrazilianStemFilterFactory() {
throw defaultCtorException();
}
@Override
public BrazilianStemFilter create(TokenStream in) {
return new BrazilianStemFilter(in);

View File

@ -54,6 +54,11 @@ public class HTMLStripCharFilterFactory extends CharFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public HTMLStripCharFilterFactory() {
throw defaultCtorException();
}
@Override
public HTMLStripCharFilter create(Reader input) {
HTMLStripCharFilter charFilter;

View File

@ -60,6 +60,11 @@ public class MappingCharFilterFactory extends CharFilterFactory implements
}
}
/** Default ctor for compatibility with SPI */
public MappingCharFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
if (mapping != null) {

View File

@ -69,6 +69,11 @@ public class CJKBigramFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public CJKBigramFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new CJKBigramFilter(input, flags, outputUnigrams);

View File

@ -49,6 +49,11 @@ public class CJKWidthFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public CJKWidthFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new CJKWidthFilter(input);

View File

@ -47,6 +47,11 @@ public class SoraniNormalizationFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public SoraniNormalizationFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new SoraniNormalizationFilter(input);

View File

@ -48,6 +48,11 @@ public class SoraniStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public SoraniStemFilterFactory() {
throw defaultCtorException();
}
@Override
public SoraniStemFilter create(TokenStream input) {
return new SoraniStemFilter(input);

View File

@ -63,6 +63,11 @@ public class CommonGramsFilterFactory extends TokenFilterFactory implements Reso
}
}
/** Default ctor for compatibility with SPI */
public CommonGramsFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
if (commonWordFiles != null) {

View File

@ -45,6 +45,11 @@ public class CommonGramsQueryFilterFactory extends CommonGramsFilterFactory {
super(args);
}
/** Default ctor for compatibility with SPI */
public CommonGramsQueryFilterFactory() {
throw defaultCtorException();
}
/**
* Create a CommonGramsFilter and wrap it with a CommonGramsQueryFilter
*/

View File

@ -65,6 +65,11 @@ public class DictionaryCompoundWordTokenFilterFactory extends TokenFilterFactory
}
}
/** Default ctor for compatibility with SPI */
public DictionaryCompoundWordTokenFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
dictionary = super.getWordSet(loader, dictFile, false);

View File

@ -90,6 +90,11 @@ public class HyphenationCompoundWordTokenFilterFactory extends TokenFilterFactor
}
}
/** Default ctor for compatibility with SPI */
public HyphenationCompoundWordTokenFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
InputStream stream = null;

View File

@ -47,6 +47,11 @@ public class DecimalDigitFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public DecimalDigitFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new DecimalDigitFilter(input);

View File

@ -42,6 +42,11 @@ public class FlattenGraphFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public FlattenGraphFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new FlattenGraphFilter(input);

View File

@ -61,6 +61,11 @@ public class KeywordTokenizerFactory extends TokenizerFactory {
}
}
/** Default ctor for compatibility with SPI */
public KeywordTokenizerFactory() {
throw defaultCtorException();
}
@Override
public KeywordTokenizer create(AttributeFactory factory) {
return new KeywordTokenizer(factory, maxTokenLen);

View File

@ -63,6 +63,11 @@ public class LetterTokenizerFactory extends TokenizerFactory {
}
}
/** Default ctor for compatibility with SPI */
public LetterTokenizerFactory() {
throw defaultCtorException();
}
@Override
public LetterTokenizer create(AttributeFactory factory) {
return new LetterTokenizer(factory, maxTokenLen);

View File

@ -48,6 +48,11 @@ public class LowerCaseFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public LowerCaseFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new LowerCaseFilter(input);

View File

@ -97,6 +97,11 @@ public class StopFilterFactory extends TokenFilterFactory implements ResourceLoa
}
}
/** Default ctor for compatibility with SPI */
public StopFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
if (stopWordFiles != null) {

View File

@ -60,6 +60,11 @@ public class TypeTokenFilterFactory extends TokenFilterFactory implements Resour
}
}
/** Default ctor for compatibility with SPI */
public TypeTokenFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
List<String> files = splitFileNames(stopTypesFiles);

View File

@ -52,6 +52,11 @@ public class UpperCaseFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public UpperCaseFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new UpperCaseFilter(input);

View File

@ -75,6 +75,11 @@ public class WhitespaceTokenizerFactory extends TokenizerFactory {
}
}
/** Default ctor for compatibility with SPI */
public WhitespaceTokenizerFactory() {
throw defaultCtorException();
}
@Override
public Tokenizer create(AttributeFactory factory) {
switch (rule) {

View File

@ -48,6 +48,11 @@ public class CzechStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public CzechStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new CzechStemFilter(input);

View File

@ -48,6 +48,11 @@ public class GermanLightStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public GermanLightStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new GermanLightStemFilter(input);

View File

@ -48,6 +48,11 @@ public class GermanMinimalStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public GermanMinimalStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new GermanMinimalStemFilter(input);

View File

@ -48,6 +48,11 @@ public class GermanNormalizationFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public GermanNormalizationFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new GermanNormalizationFilter(input);

View File

@ -49,6 +49,11 @@ public class GermanStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public GermanStemFilterFactory() {
throw defaultCtorException();
}
@Override
public GermanStemFilter create(TokenStream in) {
return new GermanStemFilter(in);

View File

@ -48,6 +48,11 @@ public class GreekLowerCaseFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public GreekLowerCaseFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream in) {
return new GreekLowerCaseFilter(in);

View File

@ -48,6 +48,11 @@ public class GreekStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public GreekStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new GreekStemFilter(input);

View File

@ -48,6 +48,11 @@ public class EnglishMinimalStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public EnglishMinimalStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new EnglishMinimalStemFilter(input);

View File

@ -48,6 +48,11 @@ public class EnglishPossessiveFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public EnglishPossessiveFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new EnglishPossessiveFilter(input);

View File

@ -49,6 +49,11 @@ public class KStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public KStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenFilter create(TokenStream input) {
return new KStemFilter(input);

View File

@ -49,6 +49,11 @@ public class PorterStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public PorterStemFilterFactory() {
throw defaultCtorException();
}
@Override
public PorterStemFilter create(TokenStream input) {
return new PorterStemFilter(input);

View File

@ -48,6 +48,11 @@ public class SpanishLightStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public SpanishLightStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new SpanishLightStemFilter(input);

View File

@ -47,6 +47,11 @@ public class SpanishMinimalStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public SpanishMinimalStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) { return new SpanishMinimalStemFilter(input); }
}

View File

@ -48,6 +48,11 @@ public class PersianCharFilterFactory extends CharFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public PersianCharFilterFactory() {
throw defaultCtorException();
}
@Override
public Reader create(Reader input) {
return new PersianCharFilter(input);

View File

@ -49,6 +49,11 @@ public class PersianNormalizationFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public PersianNormalizationFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new PersianNormalizationFilter(input);

View File

@ -48,6 +48,11 @@ public class FinnishLightStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public FinnishLightStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new FinnishLightStemFilter(input);

View File

@ -49,6 +49,11 @@ public class FrenchLightStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public FrenchLightStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new FrenchLightStemFilter(input);

View File

@ -49,6 +49,11 @@ public class FrenchMinimalStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public FrenchMinimalStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new FrenchMinimalStemFilter(input);

View File

@ -47,6 +47,11 @@ public class IrishLowerCaseFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public IrishLowerCaseFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new IrishLowerCaseFilter(input);

View File

@ -48,6 +48,11 @@ public class GalicianMinimalStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public GalicianMinimalStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new GalicianMinimalStemFilter(input);

View File

@ -48,6 +48,11 @@ public class GalicianStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public GalicianStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new GalicianStemFilter(input);

View File

@ -47,6 +47,11 @@ public class HindiNormalizationFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public HindiNormalizationFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new HindiNormalizationFilter(input);

View File

@ -47,6 +47,11 @@ public class HindiStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public HindiStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new HindiStemFilter(input);

View File

@ -48,6 +48,11 @@ public class HungarianLightStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public HungarianLightStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new HungarianLightStemFilter(input);

View File

@ -88,6 +88,11 @@ public class HunspellStemFilterFactory extends TokenFilterFactory implements Res
}
}
/** Default ctor for compatibility with SPI */
public HunspellStemFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
String dicts[] = dictionaryFiles.split(",");

View File

@ -51,6 +51,11 @@ public class IndonesianStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public IndonesianStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new IndonesianStemFilter(input, stemDerivational);

View File

@ -47,6 +47,11 @@ public class IndicNormalizationFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public IndicNormalizationFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new IndicNormalizationFilter(input);

View File

@ -48,6 +48,11 @@ public class ItalianLightStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public ItalianLightStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new ItalianLightStemFilter(input);

View File

@ -48,6 +48,11 @@ public class LatvianStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public LatvianStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new LatvianStemFilter(input);

View File

@ -51,6 +51,11 @@ public class MinHashFilterFactory extends TokenFilterFactory {
withRotation = getBoolean(args, "withRotation", bucketCount > 1);
}
/** Default ctor for compatibility with SPI */
public MinHashFilterFactory() {
throw defaultCtorException();
}
/*
* (non-Javadoc)
*

View File

@ -53,6 +53,11 @@ public class ASCIIFoldingFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public ASCIIFoldingFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new ASCIIFoldingFilter(input, preserveOriginal);

View File

@ -110,6 +110,11 @@ public class CapitalizationFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public CapitalizationFilterFactory() {
throw defaultCtorException();
}
@Override
public CapitalizationFilter create(TokenStream input) {
return new CapitalizationFilter(input, onlyFirstWord, keep,

View File

@ -54,6 +54,11 @@ public class CodepointCountFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public CodepointCountFilterFactory() {
throw defaultCtorException();
}
@Override
public CodepointCountFilter create(TokenStream input) {
return new CodepointCountFilter(input, min, max);

View File

@ -79,6 +79,11 @@ public class ConcatenateGraphFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public ConcatenateGraphFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new ConcatenateGraphFilter(input, tokenSeparator, preservePositionIncrements, maxGraphExpansions);

View File

@ -45,6 +45,11 @@ public abstract class ConditionalTokenFilterFactory extends TokenFilterFactory i
super(args);
}
/** Default ctor for compatibility with SPI */
public ConditionalTokenFilterFactory() {
throw defaultCtorException();
}
/**
* Set the inner filter factories to produce the {@link TokenFilter}s that will be
* wrapped by the {@link ConditionalTokenFilter}

View File

@ -65,6 +65,11 @@ public class DateRecognizerFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public DateRecognizerFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new DateRecognizerFilter(input, dateFormat);

View File

@ -52,6 +52,11 @@ public class DelimitedTermFrequencyTokenFilterFactory extends TokenFilterFactory
}
}
/** Default ctor for compatibility with SPI */
public DelimitedTermFrequencyTokenFilterFactory() {
throw defaultCtorException();
}
@Override
public DelimitedTermFrequencyTokenFilter create(TokenStream input) {
return new DelimitedTermFrequencyTokenFilter(input, delimiter);

View File

@ -56,6 +56,11 @@ public class FingerprintFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public FingerprintFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new FingerprintFilter(input, maxOutputTokenSize, separator);

View File

@ -37,6 +37,11 @@ public class FixBrokenOffsetsFilterFactory extends TokenFilterFactory {
super(args);
}
/** Default ctor for compatibility with SPI */
public FixBrokenOffsetsFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new FixBrokenOffsetsFilter(input);

View File

@ -48,7 +48,12 @@ public class HyphenatedWordsFilterFactory extends TokenFilterFactory {
}
}
@Override
/** Default ctor for compatibility with SPI */
public HyphenatedWordsFilterFactory() {
throw defaultCtorException();
}
@Override
public HyphenatedWordsFilter create(TokenStream input) {
return new HyphenatedWordsFilter(input);
}

View File

@ -58,6 +58,11 @@ public class KeepWordFilterFactory extends TokenFilterFactory implements Resourc
}
}
/** Default ctor for compatibility with SPI */
public KeepWordFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
if (wordFiles != null) {

View File

@ -63,6 +63,11 @@ public class KeywordMarkerFilterFactory extends TokenFilterFactory implements Re
}
}
/** Default ctor for compatibility with SPI */
public KeywordMarkerFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
if (wordFiles != null) {

View File

@ -44,6 +44,11 @@ public final class KeywordRepeatFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public KeywordRepeatFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new KeywordRepeatFilter(input);

View File

@ -55,6 +55,11 @@ public class LengthFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public LengthFilterFactory() {
throw defaultCtorException();
}
@Override
public LengthFilter create(TokenStream input) {
final LengthFilter filter = new LengthFilter(input,min,max);

View File

@ -57,6 +57,11 @@ public class LimitTokenCountFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public LimitTokenCountFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new LimitTokenCountFilter(input, maxTokenCount, consumeAllTokens);

View File

@ -56,6 +56,11 @@ public class LimitTokenOffsetFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public LimitTokenOffsetFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new LimitTokenOffsetFilter(input, maxStartOffset, consumeAllTokens);

View File

@ -56,6 +56,11 @@ public class LimitTokenPositionFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public LimitTokenPositionFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new LimitTokenPositionFilter(input, maxTokenPosition, consumeAllTokens);

View File

@ -106,6 +106,11 @@ public class ProtectedTermFilterFactory extends ConditionalTokenFilterFactory im
}
}
/** Default ctor for compatibility with SPI */
public ProtectedTermFilterFactory() {
throw defaultCtorException();
}
private void handleWrappedFilterArgs(Map<String, String> args) {
LinkedHashMap<String, Map<String, String>> wrappedFilterArgs = new LinkedHashMap<>();
splitAt(',', wrappedFilters).forEach(filterName -> { // Format: SPIname[-id]

View File

@ -48,6 +48,11 @@ public class RemoveDuplicatesTokenFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public RemoveDuplicatesTokenFilterFactory() {
throw defaultCtorException();
}
@Override
public RemoveDuplicatesTokenFilter create(TokenStream input) {
return new RemoveDuplicatesTokenFilter(input);

View File

@ -46,6 +46,11 @@ public class ScandinavianFoldingFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public ScandinavianFoldingFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new ScandinavianFoldingFilter(input);

View File

@ -46,6 +46,11 @@ public class ScandinavianNormalizationFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public ScandinavianNormalizationFilterFactory() {
throw defaultCtorException();
}
@Override
public ScandinavianNormalizationFilter create(TokenStream input) {
return new ScandinavianNormalizationFilter(input);

View File

@ -58,6 +58,11 @@ public class StemmerOverrideFilterFactory extends TokenFilterFactory implements
}
}
/** Default ctor for compatibility with SPI */
public StemmerOverrideFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
if (dictionaryFiles != null) {

View File

@ -50,6 +50,11 @@ public class TrimFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public TrimFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new TrimFilter(input);

View File

@ -57,6 +57,11 @@ public class TruncateTokenFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public TruncateTokenFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new TruncateTokenFilter(input, prefixLength);

View File

@ -55,6 +55,11 @@ public class TypeAsSynonymFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public TypeAsSynonymFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new TypeAsSynonymFilter(input, prefix);

View File

@ -110,6 +110,11 @@ public class WordDelimiterFilterFactory extends TokenFilterFactory implements Re
}
}
/** Default ctor for compatibility with SPI */
public WordDelimiterFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
if (wordFiles != null) {

View File

@ -107,6 +107,11 @@ public class WordDelimiterGraphFilterFactory extends TokenFilterFactory implemen
}
}
/** Default ctor for compatibility with SPI */
public WordDelimiterGraphFilterFactory() {
throw defaultCtorException();
}
@Override
public void inform(ResourceLoader loader) throws IOException {
if (wordFiles != null) {

View File

@ -56,6 +56,11 @@ public class EdgeNGramFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public EdgeNGramFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenFilter create(TokenStream input) {
return new EdgeNGramTokenFilter(input, minGramSize, maxGramSize, preserveOriginal);

View File

@ -53,6 +53,11 @@ public class EdgeNGramTokenizerFactory extends TokenizerFactory {
}
}
/** Default ctor for compatibility with SPI */
public EdgeNGramTokenizerFactory() {
throw defaultCtorException();
}
@Override
public Tokenizer create(AttributeFactory factory) {
return new EdgeNGramTokenizer(factory, minGramSize, maxGramSize);

View File

@ -57,6 +57,11 @@ public class NGramFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public NGramFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenFilter create(TokenStream input) {
return new NGramTokenFilter(input, minGramSize, maxGramSize, preserveOriginal);

View File

@ -55,6 +55,11 @@ public class NGramTokenizerFactory extends TokenizerFactory {
}
}
/** Default ctor for compatibility with SPI */
public NGramTokenizerFactory() {
throw defaultCtorException();
}
/** Creates the {@link TokenStream} of n-grams from the given {@link Reader} and {@link AttributeFactory}. */
@Override
public Tokenizer create(AttributeFactory factory) {

View File

@ -63,6 +63,11 @@ public class NorwegianLightStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public NorwegianLightStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new NorwegianLightStemFilter(input, flags);

View File

@ -63,6 +63,11 @@ public class NorwegianMinimalStemFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public NorwegianMinimalStemFilterFactory() {
throw defaultCtorException();
}
@Override
public TokenStream create(TokenStream input) {
return new NorwegianMinimalStemFilter(input, flags);

View File

@ -92,7 +92,12 @@ public class PathHierarchyTokenizerFactory extends TokenizerFactory {
}
}
@Override
/** Default ctor for compatibility with SPI */
public PathHierarchyTokenizerFactory() {
throw defaultCtorException();
}
@Override
public Tokenizer create(AttributeFactory factory) {
if (reverse) {
return new ReversePathHierarchyTokenizer(factory, delimiter, replacement, skip);

View File

@ -50,6 +50,12 @@ public class PatternCaptureGroupFilterFactory extends TokenFilterFactory {
pattern = getPattern(args, "pattern");
preserveOriginal = args.containsKey("preserve_original") ? Boolean.parseBoolean(args.get("preserve_original")) : true;
}
/** Default ctor for compatibility with SPI */
public PatternCaptureGroupFilterFactory() {
throw defaultCtorException();
}
@Override
public PatternCaptureGroupTokenFilter create(TokenStream input) {
return new PatternCaptureGroupTokenFilter(input, preserveOriginal, pattern);

View File

@ -55,6 +55,11 @@ public class PatternReplaceCharFilterFactory extends CharFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public PatternReplaceCharFilterFactory() {
throw defaultCtorException();
}
@Override
public Reader create(Reader input) {
return new PatternReplaceCharFilter(pattern, replacement, input);

View File

@ -60,6 +60,11 @@ public class PatternReplaceFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public PatternReplaceFilterFactory() {
throw defaultCtorException();
}
@Override
public PatternReplaceFilter create(TokenStream input) {
return new PatternReplaceFilter(input, pattern, replacement, replaceAll);

View File

@ -80,6 +80,11 @@ public class PatternTokenizerFactory extends TokenizerFactory {
}
}
/** Default ctor for compatibility with SPI */
public PatternTokenizerFactory() {
throw defaultCtorException();
}
/**
* Split the input using configured pattern
*/

View File

@ -76,6 +76,11 @@ public class SimplePatternSplitTokenizerFactory extends TokenizerFactory {
}
}
/** Default ctor for compatibility with SPI */
public SimplePatternSplitTokenizerFactory() {
throw defaultCtorException();
}
@Override
public SimplePatternSplitTokenizer create(final AttributeFactory factory) {
return new SimplePatternSplitTokenizer(factory, dfa);

View File

@ -76,6 +76,11 @@ public class SimplePatternTokenizerFactory extends TokenizerFactory {
}
}
/** Default ctor for compatibility with SPI */
public SimplePatternTokenizerFactory() {
throw defaultCtorException();
}
@Override
public SimplePatternTokenizer create(final AttributeFactory factory) {
return new SimplePatternTokenizer(factory, dfa);

View File

@ -60,6 +60,11 @@ public class DelimitedPayloadTokenFilterFactory extends TokenFilterFactory imple
}
}
/** Default ctor for compatibility with SPI */
public DelimitedPayloadTokenFilterFactory() {
throw defaultCtorException();
}
@Override
public DelimitedPayloadTokenFilter create(TokenStream input) {
return new DelimitedPayloadTokenFilter(input, delimiter, encoder);

View File

@ -52,6 +52,11 @@ public class NumericPayloadTokenFilterFactory extends TokenFilterFactory {
}
}
/** Default ctor for compatibility with SPI */
public NumericPayloadTokenFilterFactory() {
throw defaultCtorException();
}
@Override
public NumericPayloadTokenFilter create(TokenStream input) {
return new NumericPayloadTokenFilter(input,payload,typeMatch);

Some files were not shown because too many files have changed in this diff Show More