: Regarding reflection - even if reflection is slower, and I'm sure it is, : I just don't know exactly how much slower it is, couldn't we cache the : instantiated instances keyed off by name? Such instances would have to : be thread-safe, but I imagine most/all Tokenizers already are : thread-safe.
most instances of Tokenizer and TokenFilter aren't threadsafe -- i'm not sure how they could be given that the only real method they have is "next()" ... everyone implementation i know of is constructed using a Reader or TokenStream (depending on wether it's a Tokenizer or TokenFilter) ... so reuse with new input is a bit hard as i mentioned in one of the threads i linked to, the best we can probably do is resolve the classname into a Class object in the init methods of a ReflectionTOkenFilterFactory or ReflectionTokenizerFactory class, but a new instance really needs to be constructed everytime the create() methods are called. like i said though: i'm in favore of factories like this ... i just don't think we should do anything to hide their use and make refering to Tokenizer or TOkenFilter class names directly use reflection magicly. : http://www.nabble.com/Re%3A-making-schema.xml-nicer-to-read-use-p5939980.html : http://www.nabble.com/foo-tf1737025.html#a4720545 -Hoss