@Test public void testCreateTokenFilter() throws Exception{ Properties properties = new Properties(); properties.setProperty(RegExpFilterFactory.REGEXP, TEST_REGEXP); properties.setProperty(RegExpFilterFactory.REPLACEMENT, TEST_REPLACEMENT); RegExpFilter regExpFilter = (RegExpFilter) regExpFilterFactory.createTokenFilter(tokenStream, properties); assertEquals(TEST_REGEXP, regExpFilter.getRegExp()); assertEquals(TEST_REPLACEMENT, regExpFilter.getReplacement()); }
public TokenFilter createTokenFilter(TokenStream tokenStream, Properties properties) throws IOException { String regexp = (String) properties.get(REGEXP); String replacement = (String) properties.get(REPLACEMENT); if (regexp == null || replacement == null) throw new IllegalArgumentException("Attributes " + REGEXP + " and " + REPLACEMENT + " must be provided for RegExpFilter."); return new RegExpFilter(tokenStream, regexp, replacement); }
RegExpFilterFactory implements TokenFilterFactory { public TokenFilter createTokenFilter(TokenStream tokenStream, Properties properties) throws IOException { String regexp = (String) properties.get(REGEXP); String replacement = (String) properties.get(REPLACEMENT); if (regexp == null || replacement == null) throw new IllegalArgumentException("Attributes " + REGEXP + " and " + REPLACEMENT + " must be provided for RegExpFilter."); return new RegExpFilter(tokenStream, regexp, replacement); } }
RegExpFilterFactory implements TokenFilterFactory { public TokenFilter createTokenFilter(TokenStream tokenStream, Properties properties) throws IOException { String regexp = (String) properties.get(REGEXP); String replacement = (String) properties.get(REPLACEMENT); if (regexp == null || replacement == null) throw new IllegalArgumentException("Attributes " + REGEXP + " and " + REPLACEMENT + " must be provided for RegExpFilter."); return new RegExpFilter(tokenStream, regexp, replacement); }  }
RegExpFilterFactory implements TokenFilterFactory { public TokenFilter createTokenFilter(TokenStream tokenStream, Properties properties) throws IOException { String regexp = (String) properties.get(REGEXP); String replacement = (String) properties.get(REPLACEMENT); if (regexp == null || replacement == null) throw new IllegalArgumentException("Attributes " + REGEXP + " and " + REPLACEMENT + " must be provided for RegExpFilter."); return new RegExpFilter(tokenStream, regexp, replacement); }  void preloadResources(Properties properties); TokenFilter createTokenFilter(TokenStream tokenStream,
			Properties properties); }
RegExpFilterFactory implements TokenFilterFactory { public TokenFilter createTokenFilter(TokenStream tokenStream, Properties properties) throws IOException { String regexp = (String) properties.get(REGEXP); String replacement = (String) properties.get(REPLACEMENT); if (regexp == null || replacement == null) throw new IllegalArgumentException("Attributes " + REGEXP + " and " + REPLACEMENT + " must be provided for RegExpFilter."); return new RegExpFilter(tokenStream, regexp, replacement); }  void preloadResources(Properties properties); TokenFilter createTokenFilter(TokenStream tokenStream,
			Properties properties); static final String REGEXP; static final String REPLACEMENT; }