Package org.apache.lucene.xmlparser.builders

Source Code of org.apache.lucene.xmlparser.builders.RangeFilterBuilder

/*
* Created on 25-Jan-2006
*/
package org.apache.lucene.xmlparser.builders;

import org.apache.lucene.search.Filter;
import org.apache.lucene.search.RangeFilter;
import org.apache.lucene.xmlparser.DOMUtils;
import org.apache.lucene.xmlparser.FilterBuilder;
import org.apache.lucene.xmlparser.ParserException;
import org.w3c.dom.Element;



/**
* @author maharwood
*/
public class RangeFilterBuilder implements FilterBuilder {


  public Filter getFilter(Element e) throws ParserException {
   
    String fieldName=DOMUtils.getAttributeWithInheritance(e,"fieldName");
   
    String lowerTerm=e.getAttribute("lowerTerm");
    String upperTerm=e.getAttribute("upperTerm");
    boolean includeLower=DOMUtils.getAttribute(e,"includeLower",true);
    boolean includeUpper=DOMUtils.getAttribute(e,"includeUpper",true);
    return new RangeFilter(fieldName,lowerTerm,upperTerm,includeLower,includeUpper);
  }

}
TOP

Related Classes of org.apache.lucene.xmlparser.builders.RangeFilterBuilder

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.