Package com.attivio.util.parser
Class QueryParsers
- java.lang.Object
-
- com.attivio.util.parser.QueryParsers
-
public class QueryParsers extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description QueryParsers()
QueryParsers(QueryOperators operators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PhraseQuery
createPhraseQuery(SearchTerm term, boolean quoted)
Hook to allow initializing aPhraseQuery
.Query
eval(QueryString query)
Hook to allow inline parsing ofquery
.java.lang.String
getDefaultSearchField()
java.util.TimeZone
getTimeZone()
java.lang.Object
parseObject(StringParser reader)
Parse a value.Phrase
parsePhrase(ScopeTerm scope, StringParser reader)
Parse the nextPhrase
fromreader
.Phrase
parsePhrase(java.lang.String op, int startOffset, ScopeTerm scope, StringParser reader)
Phrase
parsePhraseTerm(ScopeTerm scope, java.lang.String text, StringParser reader)
Query
parseQuery(ScopeTerm scope, StringParser reader)
Parse the next Query.Query
parseQuery(java.lang.String value)
Query
parseQuery(java.lang.String op, int startOffset, ScopeTerm scope, StringParser reader)
Parseop
as a query.Query
parseQueryEx(java.lang.String value)
Query
parseQueryTerm(ScopeTerm scope, java.lang.String text, StringParser reader)
SearchTerm
parseSearchTerm(StringParser reader)
SearchTerm
setOffset(SearchTerm term, int startOffset, int endOffset)
Hook to allow annotating search terms with start/end offset.
-
-
-
Constructor Detail
-
QueryParsers
public QueryParsers()
-
QueryParsers
public QueryParsers(QueryOperators operators)
-
-
Method Detail
-
getDefaultSearchField
public java.lang.String getDefaultSearchField()
-
getTimeZone
public java.util.TimeZone getTimeZone()
-
parseQuery
public Query parseQuery(java.lang.String value)
-
parseQueryEx
public Query parseQueryEx(java.lang.String value) throws java.text.ParseException
- Throws:
java.text.ParseException
-
eval
public Query eval(QueryString query)
Hook to allow inline parsing ofquery
.
-
createPhraseQuery
public PhraseQuery createPhraseQuery(SearchTerm term, boolean quoted)
Hook to allow initializing aPhraseQuery
.
-
setOffset
public SearchTerm setOffset(SearchTerm term, int startOffset, int endOffset)
Hook to allow annotating search terms with start/end offset.
-
parseSearchTerm
public SearchTerm parseSearchTerm(StringParser reader) throws java.text.ParseException
- Throws:
java.text.ParseException
-
parseObject
public java.lang.Object parseObject(StringParser reader) throws java.text.ParseException
Parse a value.- Throws:
java.text.ParseException
-
parseQuery
public Query parseQuery(ScopeTerm scope, StringParser reader) throws java.text.ParseException
Parse the next Query.- Throws:
java.text.ParseException
-
parseQuery
public Query parseQuery(java.lang.String op, int startOffset, ScopeTerm scope, StringParser reader) throws java.text.ParseException
Parseop
as a query.- Throws:
java.text.ParseException
-
parsePhrase
public Phrase parsePhrase(ScopeTerm scope, StringParser reader) throws java.text.ParseException
Parse the nextPhrase
fromreader
.- Throws:
java.text.ParseException
-
parsePhrase
public Phrase parsePhrase(java.lang.String op, int startOffset, ScopeTerm scope, StringParser reader) throws java.text.ParseException
- Throws:
java.text.ParseException
-
parseQueryTerm
public Query parseQueryTerm(ScopeTerm scope, java.lang.String text, StringParser reader) throws java.text.ParseException
- Throws:
java.text.ParseException
-
parsePhraseTerm
public Phrase parsePhraseTerm(ScopeTerm scope, java.lang.String text, StringParser reader) throws java.text.ParseException
- Throws:
java.text.ParseException
-
-