@Test public void analyzerByComposition_Tokenizer() throws Exception{ NodeBuilder nb = EMPTY_NODE.builder(); nb.child(ANL_TOKENIZER).setProperty(ANL_NAME, "whitespace"); TokenizerChain analyzer = (TokenizerChain) factory.createInstance(nb.getNodeState()); assertEquals(WhitespaceTokenizerFactory.class.getName(), analyzer.getTokenizer().getClassArg()); nb.child(ANL_TOKENIZER) .setProperty(ANL_NAME, "pathhierarchy") .setProperty("delimiter", "#"); analyzer = (TokenizerChain) factory.createInstance(nb.getNodeState()); assertEquals(PathHierarchyTokenizerFactory.class.getName(), analyzer.getTokenizer().getClassArg()); assertEquals('#', getValue(analyzer.getTokenizer(), "delimiter")); }
public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } NodeStateAnalyzerFactory(Version defaultVersion);   NodeStateAnalyzerFactory(ResourceLoader defaultLoader, Version defaultVersion); }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } NodeStateAnalyzerFactory(Version defaultVersion);   NodeStateAnalyzerFactory(ResourceLoader defaultLoader, Version defaultVersion); Analyzer createInstance(NodeState state); }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } NodeStateAnalyzerFactory(Version defaultVersion);   NodeStateAnalyzerFactory(ResourceLoader defaultLoader, Version defaultVersion); Analyzer createInstance(NodeState state);  }