Class TokenFilterFactory


public abstract class TokenFilterFactory extends AbstractAnalysisFactory
Abstract parent class for analysis factories that create TokenFilter instances.
  • Constructor Details

    • TokenFilterFactory

      protected TokenFilterFactory()
      Default ctor for compatibility with SPI
    • TokenFilterFactory

      protected TokenFilterFactory(Map<String,String> args)
      Initialize this factory via a set of key-value pairs.
  • Method Details

    • forName

      public static TokenFilterFactory forName(String name, Map<String,String> args)
      looks up a tokenfilter by name from context classpath
    • lookupClass

      public static Class<? extends TokenFilterFactory> lookupClass(String name)
      looks up a tokenfilter class by name from context classpath
    • availableTokenFilters

      public static Set<String> availableTokenFilters()
      returns a list of all available tokenfilter names from context classpath
    • findSPIName

      public static String findSPIName(Class<? extends TokenFilterFactory> serviceClass)
      looks up a SPI name for the specified token filter factory
    • reloadTokenFilters

      public static void reloadTokenFilters(ClassLoader classloader)
      Reloads the factory list from the given ClassLoader. Changes to the factories are visible after the method ends, all iterators (availableTokenFilters(),...) 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

      public abstract TokenStream create(TokenStream input)
      Transform the specified input TokenStream
    • normalize

      public TokenStream normalize(TokenStream input)
      Normalize the specified input TokenStream While the default implementation returns input unchanged, filters that should be applied at normalization time can delegate to create method.