org.apache.lucene.xmlparser
Class CoreParser

java.lang.Object
  extended by org.apache.lucene.xmlparser.CoreParser
All Implemented Interfaces:
QueryBuilder
Direct Known Subclasses:
CorePlusExtensionsParser

public class CoreParser
extends Object
implements QueryBuilder

Assembles a QueryBuilder which uses only core Lucene Query objects


Field Summary
protected  Analyzer analyzer
           
protected  FilterBuilderFactory filterFactory
           
static int maxNumCachedFilters
           
protected  QueryParser parser
           
protected  QueryBuilderFactory queryFactory
           
 
Constructor Summary
  CoreParser(Analyzer analyzer, QueryParser parser)
          Construct an XML parser that uses a single instance QueryParser for handling UserQuery tags - all parse operations are synchronised on this parser
  CoreParser(String defaultField, Analyzer analyzer)
          Constructs an XML parser that creates a QueryParser for each UserQuery request.
protected CoreParser(String defaultField, Analyzer analyzer, QueryParser parser)
           
 
Method Summary
 void addFilterBuilder(String nodeName, FilterBuilder builder)
           
 void addQueryBuilder(String nodeName, QueryBuilder builder)
           
 Query getQuery(Element e)
           
 Query parse(InputStream xmlStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

analyzer

protected Analyzer analyzer

parser

protected QueryParser parser

queryFactory

protected QueryBuilderFactory queryFactory

filterFactory

protected FilterBuilderFactory filterFactory

maxNumCachedFilters

public static int maxNumCachedFilters
Constructor Detail

CoreParser

public CoreParser(Analyzer analyzer,
                  QueryParser parser)
Construct an XML parser that uses a single instance QueryParser for handling UserQuery tags - all parse operations are synchronised on this parser

Parameters:
analyzer -
parser - A QueryParser which will be synchronized on during parse calls.

CoreParser

public CoreParser(String defaultField,
                  Analyzer analyzer)
Constructs an XML parser that creates a QueryParser for each UserQuery request.

Parameters:
defaultField - The default field name used by QueryParsers constructed for UserQuery tags
analyzer -

CoreParser

protected CoreParser(String defaultField,
                     Analyzer analyzer,
                     QueryParser parser)
Method Detail

parse

public Query parse(InputStream xmlStream)
            throws ParserException
Throws:
ParserException

addQueryBuilder

public void addQueryBuilder(String nodeName,
                            QueryBuilder builder)

addFilterBuilder

public void addFilterBuilder(String nodeName,
                             FilterBuilder builder)

getQuery

public Query getQuery(Element e)
               throws ParserException
Specified by:
getQuery in interface QueryBuilder
Throws:
ParserException


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.