no.sesat.search.query.parser
Class AbstractQueryParserContext

java.lang.Object
  extended by no.sesat.search.query.parser.AbstractQueryParserContext
All Implemented Interfaces:
no.sesat.commons.ioc.BaseContext, QueryParser.Context, QueryStringContext, TokenEvaluationEngineContext

public abstract class AbstractQueryParserContext
extends Object
implements QueryParser.Context

Default implementation of QueryParser.Context's createXxxClause methods.

Version:
$Id: AbstractQueryParserContext.java 7225 2009-04-09 00:32:20Z ssmiweve $

Constructor Summary
AbstractQueryParserContext()
          Creates a new instance of AbstractQueryParserContext.
 
Method Summary
 AndClause createAndClause(Clause first, Clause second)
          Creator wrapper method for AndClause objects.
 AndNotClause createAndNotClause(Clause first)
          Creator wrapper method for AndNotClause objects.
 DefaultOperatorClause createDefaultOperatorClause(Clause first, Clause second)
          Creator wrapper method for DefaultOperatorClause objects.
 EmailClause createEmailClause(String term, String field)
          Creator wrapper method for EmailClause objects.
 IntegerClause createIntegerClause(String term, String field)
          Creator wrapper method for IntegerClause objects.
 NotClause createNotClause(Clause first)
          Creator wrapper method for NotClause objects.
 NumberGroupClause createNumberGroupClause(String term, String field)
          Creator wrapper method for NumberGroupClause objects.
 OrClause createOrClause(Clause first, Clause second)
          Creator wrapper method for OrClause objects.
 PhoneNumberClause createPhoneNumberClause(String term, String field)
          Creator wrapper method for PhoneNumberClause objects.
 PhraseClause createPhraseClause(String term, String field)
          Creator wrapper method for PhraseClause objects.
 UrlClause createUrlClause(String term, String field)
          Creator wrapper method for UrlClause objects.
 WordClause createWordClause(String term, String field)
          Creator wrapper method for WordClause objects.
 XorClause createXorClause(Clause first, Clause second, XorClause.Hint hint)
          Creator wrapper method for XorClause objects.
 String getQueryString()
          Get the original query string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface no.sesat.search.query.token.TokenEvaluationEngineContext
getTokenEvaluationEngine
 

Constructor Detail

AbstractQueryParserContext

public AbstractQueryParserContext()
Creates a new instance of AbstractQueryParserContext.

Method Detail

getQueryString

public final String getQueryString()
Get the original query string.

Specified by:
getQueryString in interface QueryStringContext
Returns:
the original query string.

createDefaultOperatorClause

public DefaultOperatorClause createDefaultOperatorClause(Clause first,
                                                         Clause second)
Creator wrapper method for DefaultOperatorClause objects. The methods also allow a chunk of creation logic for the DefaultOperatorClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createDefaultOperatorClause in interface QueryParser.Context
Parameters:
first - the left child clause of the operation clause we are about to create (or find).
second - the right child clause of the operation clause we are about to create (or find).
Returns:
returns a DefaultOperatorClause matching the term, left and right child clauses.

createAndClause

public final AndClause createAndClause(Clause first,
                                       Clause second)
Creator wrapper method for AndClause objects. The methods also allow a chunk of creation logic for the AndClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createAndClause in interface QueryParser.Context
Parameters:
first - the left child clause of the operation clause we are about to create (or find).
second - the right child clause of the operation clause we are about to create (or find).
Returns:
returns a AndClause instance matching the term, left and right child clauses.

createOrClause

public final OrClause createOrClause(Clause first,
                                     Clause second)
Creator wrapper method for OrClause objects. The methods also allow a chunk of creation logic for the OrClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createOrClause in interface QueryParser.Context
Parameters:
first - the left child clause of the operation clause we are about to create (or find).
second - the right child clause of the operation clause we are about to create (or find).
Returns:
returns a OrOrClauseImplnstance matching the term, left and right child clauses.

createXorClause

public final XorClause createXorClause(Clause first,
                                       Clause second,
                                       XorClause.Hint hint)
Creator wrapper method for XorClause objects. The methods also allow a chunk of creation logic for the XorClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createXorClause in interface QueryParser.Context
Parameters:
first - the left child clause of the operation clause we are about to create (or find).
second - the right child clause of the operation clause we are about to create (or find).
Returns:
returns a OrOrClauseImplnstance matching the term, left and right child clauses.

createAndNotClause

public final AndNotClause createAndNotClause(Clause first)
Creator wrapper method for AndNotClause objects. The methods also allow a chunk of creation logic for the AndNotClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createAndNotClause in interface QueryParser.Context
Parameters:
first - the left child clause of the operation clause we are about to create (or find).
Returns:
returns a AnAndNotClauseImplnstance matching the term, left and right child clauses.

createNotClause

public final NotClause createNotClause(Clause first)
Creator wrapper method for NotClause objects. The methods also allow a chunk of creation logic for the NotClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createNotClause in interface QueryParser.Context
Parameters:
first - the left child clause of the operation clause we are about to create (or find).
Returns:
returns a NNotClauseImplinstance matching the term, left and right child clauses.

createWordClause

public final WordClause createWordClause(String term,
                                         String field)
Creator wrapper method for WordClause objects. The methods also allow a chunk of creation logic for the WordClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createWordClause in interface QueryParser.Context
Parameters:
term - the term this clause represents.
field - any field this clause was specified against.
Returns:
returns a WoWordClauseImplnstance matching the term, left and right child clauses.

createPhraseClause

public final PhraseClause createPhraseClause(String term,
                                             String field)
Creator wrapper method for PhraseClause objects. The methods also allow a chunk of creation logic for the PhraseClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createPhraseClause in interface QueryParser.Context
Parameters:
term - the term this clause represents.
field - any field this clause was specified against.
Returns:
returns a PhPhraseClauseImplnstance matching the term, left and right child clauses.

createIntegerClause

public final IntegerClause createIntegerClause(String term,
                                               String field)
Creator wrapper method for IntegerClause objects. The methods also allow a chunk of creation logic for the IntegerClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createIntegerClause in interface QueryParser.Context
Parameters:
term - the term this clause represents.
field - any field this clause was specified against.
Returns:
returns a InIntegerClauseImplnstance matching the term, left and right child clauses.

createPhoneNumberClause

public final PhoneNumberClause createPhoneNumberClause(String term,
                                                       String field)
Creator wrapper method for PhoneNumberClause objects. The methods also allow a chunk of creation logic for the PhoneNumberClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createPhoneNumberClause in interface QueryParser.Context
Parameters:
term - the term this clause represents.
field - any field this clause was specified against.
Returns:
returns a PhPhoneNumberClauseImplnstance matching the term, left and right child clauses.

createNumberGroupClause

public final NumberGroupClause createNumberGroupClause(String term,
                                                       String field)
Creator wrapper method for NumberGroupClause objects. The methods also allow a chunk of creation logic for the NumberGroupClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createNumberGroupClause in interface QueryParser.Context
Parameters:
term - the term this clause represents.
field - any field this clause was specified against.
Returns:
returns a OrOrganisationNumberClauseImplnstance matching the term, left and right child clauses.

createUrlClause

public final UrlClause createUrlClause(String term,
                                       String field)
Creator wrapper method for UrlClause objects. The methods also allow a chunk of creation logic for the UrlClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createUrlClause in interface QueryParser.Context
Parameters:
term - the term this clause represents.
field - any field this clause was specified against.
Returns:
returns a UrlClause matching the term, left and right child clauses.

createEmailClause

public final EmailClause createEmailClause(String term,
                                           String field)
Creator wrapper method for EmailClause objects. The methods also allow a chunk of creation logic for the EmailClause to be moved out of the QueryParserImpl.jj file to here.

Specified by:
createEmailClause in interface QueryParser.Context
Parameters:
term - the term this clause represents.
field - any field this clause was specified against.
Returns:
returns a EmailClause matching the term, left and right child clauses.


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.