Interface QueryParser
-
- All Superinterfaces:
FlyweightPrototype<QueryParser>
- All Known Implementing Classes:
SimpleParser
public interface QueryParser extends FlyweightPrototype<QueryParser>
A parser transforming query strings in compositeQueryobjects.Besides the obvious
parse(String)/parse(MutableString)methods, a query parser must provide anescape(String)/escape(MutableString)method that can be used to turn arbitrary strings into text tokens.- Author:
- Sebastiano Vigna
-
-
Method Summary
Modifier and Type Method Description MutableStringescape(MutableString token)Escapes the provided mutable string, making it into a text token.Stringescape(String token)Escapes the provided string, making it into a text token.Queryparse(MutableString query)Turns the given query mutable string into a compositeQueryobject.Queryparse(String query)Turns the given query string into a compositeQueryobject.-
Methods inherited from interface it.unimi.dsi.lang.FlyweightPrototype
copy
-
-
-
-
Method Detail
-
parse
Query parse(String query) throws QueryParserException
Turns the given query string into a compositeQueryobject.- Parameters:
query- a string representing a query.- Returns:
- the corresponding composite object.
- Throws:
QueryParserException
-
parse
Query parse(MutableString query) throws QueryParserException
Turns the given query mutable string into a compositeQueryobject.- Parameters:
query- a mutable string representing a query.- Returns:
- the corresponding composite object.
- Throws:
QueryParserException
-
escape
String escape(String token)
Escapes the provided string, making it into a text token.- Parameters:
token- a wannabe text token (maybe containing special characters, but no character below code 32).- Returns:
- an escaped representation of
tokenthat will be interpreted as a text token by this parser.
-
escape
MutableString escape(MutableString token)
Escapes the provided mutable string, making it into a text token.- Parameters:
token- a wannabe text token (maybe containing special characters, but no character below code 32).- Returns:
token, escaped so that it will be interpreted as a text token by this parser.
-
-