|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectno.sesat.search.query.parser.AbstractQueryParser
public abstract class AbstractQueryParser
Abstract helper for implementing a QueryParser Provides default implementation to get the query object.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface no.sesat.search.query.parser.QueryParser |
|---|
QueryParser.Context |
| Field Summary | |
|---|---|
protected QueryParser.Context |
context
the context this query parser implementation must work against. |
protected static String |
ERR_EMPTY_CONTEXT
Error message when the parser tries to parse an empty query string. |
protected static Logger |
LOG
Protected so an .jj file implementing this class can reuse. |
static String |
OPERATOR_REGEX
|
static String |
SKIP_REGEX
|
| Fields inherited from interface no.sesat.search.query.parser.QueryParser |
|---|
OPERATORS, SKIP_CHARACTER_RANGES |
| Constructor Summary | |
|---|---|
AbstractQueryParser()
|
|
| Method Summary | |
|---|---|
protected String |
balance(String query,
char leftChar,
char rightChar)
Ensure that for every leftChar there is a matching rightChar. |
protected QueryParser.Context |
createContext(String input)
Create a new context the return the argument on any call to its getQueryString() method. |
protected void |
enterMethod(String method,
Token token)
Debugging method for tracing a method entry. |
protected String |
even(String query,
char c)
Ensure that there are a even number of c characters in the phrase, otherwise remove all occurences of c. |
protected void |
exitMethod()
Debugging method for tracing a method exit. |
protected String |
fixFloatingHyphon(String query)
HACK because a floating hyphon is interpretted as a NotClause. |
Query |
getQuery()
Get the query object. |
protected String |
numberNeedsTrailingSpace(String query)
HACK because phone numbers and organisation numbers need to finish with a space. |
abstract Clause |
parse()
do the actual parsing. |
protected abstract void |
ReInit(Reader reader)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SKIP_REGEX
public static final String OPERATOR_REGEX
protected static final Logger LOG
protected static final String ERR_EMPTY_CONTEXT
protected transient QueryParser.Context context
| Constructor Detail |
|---|
public AbstractQueryParser()
| Method Detail |
|---|
public abstract Clause parse()
throws ParseException
ParseException - when parsing the inputted query string.public Query getQuery()
getQuery in interface QueryParserprotected final QueryParser.Context createContext(String input)
input - the query string returned from the created context's getQueryString() method.
protected final void enterMethod(String method,
Token token)
method - the name of the methodprotected final void exitMethod()
protected final String balance(String query,
char leftChar,
char rightChar)
query - leftChar - rightChar -
protected final String even(String query,
char c)
query - c - the character to ensure has an even occurence count.
protected final String numberNeedsTrailingSpace(String query)
query -
protected final String fixFloatingHyphon(String query)
query -
protected abstract void ReInit(Reader reader)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||