Example usage for org.apache.lucene.util AttributeFactory AttributeFactory

List of usage examples for org.apache.lucene.util AttributeFactory AttributeFactory

Introduction

In this page you can find the example usage for org.apache.lucene.util AttributeFactory AttributeFactory.

Prototype

AttributeFactory

Source Link

Usage

From source file:com.shaie.XMLParsingTokenizer.java

License:Apache License

/** Make this Tokenizer get attributes from the delegate token stream. */
private static final AttributeFactory delegatingAttributeFactory(final AttributeSource source) {
    return new AttributeFactory() {
        @Override/*from  w ww  .j a v  a 2  s  . c om*/
        public AttributeImpl createAttributeInstance(Class<? extends Attribute> attClass) {
            return (AttributeImpl) source.addAttribute(attClass);
        }
    };
}