@Test public void testCreateTokenFilter() throws Exception{ Properties properties = new Properties(); properties.setProperty(AdditionFilterFactory.POSTFIX_POSITION, TEST_STRING); AdditionFilter additionFilter = (AdditionFilter) additionFilterFactory.createTokenFilter(tokenStream, properties); assertEquals(AdditionFilter.POSTFIX, additionFilter.getPosition()); assertEquals(TEST_STRING, additionFilter.getAddition()); }
public TokenFilter createTokenFilter(TokenStream tokenStream, Properties properties) throws IOException { String postfix = properties.getProperty(POSTFIX_POSITION); String addition = null; Integer position = null; if( postfix != null ){ position = AdditionFilter.POSTFIX; addition = postfix; } else { String prefix = properties.getProperty(PREFIX_POSITION); if( prefix != null ){ position = AdditionFilter.PREFIX; addition = prefix; } else throw new IllegalArgumentException("no postfix or prefix attribute provided"); } return new AdditionFilter(tokenStream, addition, position); }
AdditionFilterFactory implements TokenFilterFactory { public TokenFilter createTokenFilter(TokenStream tokenStream, Properties properties) throws IOException { String postfix = properties.getProperty(POSTFIX_POSITION); String addition = null; Integer position = null; if( postfix != null ){ position = AdditionFilter.POSTFIX; addition = postfix; } else { String prefix = properties.getProperty(PREFIX_POSITION); if( prefix != null ){ position = AdditionFilter.PREFIX; addition = prefix; } else throw new IllegalArgumentException("no postfix or prefix attribute provided"); } return new AdditionFilter(tokenStream, addition, position); } }
AdditionFilterFactory implements TokenFilterFactory { public TokenFilter createTokenFilter(TokenStream tokenStream, Properties properties) throws IOException { String postfix = properties.getProperty(POSTFIX_POSITION); String addition = null; Integer position = null; if( postfix != null ){ position = AdditionFilter.POSTFIX; addition = postfix; } else { String prefix = properties.getProperty(PREFIX_POSITION); if( prefix != null ){ position = AdditionFilter.PREFIX; addition = prefix; } else throw new IllegalArgumentException("no postfix or prefix attribute provided"); } return new AdditionFilter(tokenStream, addition, position); }  }
AdditionFilterFactory implements TokenFilterFactory { public TokenFilter createTokenFilter(TokenStream tokenStream, Properties properties) throws IOException { String postfix = properties.getProperty(POSTFIX_POSITION); String addition = null; Integer position = null; if( postfix != null ){ position = AdditionFilter.POSTFIX; addition = postfix; } else { String prefix = properties.getProperty(PREFIX_POSITION); if( prefix != null ){ position = AdditionFilter.PREFIX; addition = prefix; } else throw new IllegalArgumentException("no postfix or prefix attribute provided"); } return new AdditionFilter(tokenStream, addition, position); }  TokenFilter createTokenFilter(TokenStream tokenStream,
			Properties properties); void preloadResources(Properties properties); }
AdditionFilterFactory implements TokenFilterFactory { public TokenFilter createTokenFilter(TokenStream tokenStream, Properties properties) throws IOException { String postfix = properties.getProperty(POSTFIX_POSITION); String addition = null; Integer position = null; if( postfix != null ){ position = AdditionFilter.POSTFIX; addition = postfix; } else { String prefix = properties.getProperty(PREFIX_POSITION); if( prefix != null ){ position = AdditionFilter.PREFIX; addition = prefix; } else throw new IllegalArgumentException("no postfix or prefix attribute provided"); } return new AdditionFilter(tokenStream, addition, position); }  TokenFilter createTokenFilter(TokenStream tokenStream,
			Properties properties); void preloadResources(Properties properties); static final String POSTFIX_POSITION; static final String PREFIX_POSITION; }