FileDocCategorySizeDatePackage
BooleanFilterBuilder.javaAPI DocApache Lucene 2.1.02131Wed Feb 14 10:46:20 GMT 2007org.apache.lucene.xmlparser.builders

BooleanFilterBuilder

public class BooleanFilterBuilder extends Object implements org.apache.lucene.xmlparser.FilterBuilder
author
maharwood

Fields Summary
private org.apache.lucene.xmlparser.FilterBuilder
factory
Constructors Summary
public BooleanFilterBuilder(org.apache.lucene.xmlparser.FilterBuilder factory)

		this.factory=factory;
	
Methods Summary
public org.apache.lucene.search.FiltergetFilter(org.w3c.dom.Element e)

		BooleanFilter bf=new BooleanFilter();
		NodeList nl = e.getChildNodes();
		
		for(int i=0;i<nl.getLength();i++)
		{
			Node node = nl.item(i);
			if(node.getNodeName().equals("Clause"))
			{
				Element clauseElem=(Element) node;
				BooleanClause.Occur occurs=BooleanQueryBuilder.getOccursValue(clauseElem);
			
	 			Element clauseFilter=DOMUtils.getFirstChildOrFail(clauseElem);
	 			Filter f=factory.getFilter(clauseFilter);
	 			bf.add(new FilterClause(f,occurs));
			}
		}
		
		return bf;