@ThreadSafe public class QueryParsers extends Object
QueryParser implementations that can be used to parse queries by language.| Constructor and Description |
|---|
QueryParsers(Iterable<QueryParser> parsers)
Create a new collection of the supplied
QueryParser objects. |
QueryParsers(QueryParser... parsers)
Create a new collection of the supplied
QueryParser objects. |
| Modifier and Type | Method and Description |
|---|---|
void |
addLanguage(QueryParser languageParser)
Add a language to this engine by supplying its parser.
|
void |
addLanguages(Iterable<QueryParser> languages)
Add one or more languages to this engine by supplying the corresponding parsers.
|
void |
addLanguages(QueryParser firstLanguage,
QueryParser... additionalLanguages)
Add one or more languages to this engine by supplying the corresponding parsers.
|
boolean |
equals(Object obj) |
Set<String> |
getLanguages()
Get the set of languages that this engine is capable of parsing.
|
QueryParser |
getParserFor(String language)
Get the parser for the supplied language.
|
int |
hashCode() |
QueryCommand |
parse(TypeSystem typeSystem,
String language,
String query)
Execute the supplied query by planning, optimizing, and then processing it.
|
QueryParser |
removeLanguage(String language)
Remove from this engine the language with the given name.
|
Collection<QueryParser> |
removeLanguages(String firstLanguage,
String... additionalLanguages)
Remove from this engine the language with the given name.
|
String |
toString() |
public QueryParsers(QueryParser... parsers)
QueryParser objects.parsers - the parserspublic QueryParsers(Iterable<QueryParser> parsers)
QueryParser objects.parsers - the parserspublic void addLanguage(QueryParser languageParser)
languageParser - the query parser for the languageIllegalArgumentException - if the language parser is nullpublic void addLanguages(QueryParser firstLanguage, QueryParser... additionalLanguages)
firstLanguage - the query parser for the first languageadditionalLanguages - the query parsers for the additional languagesIllegalArgumentException - if the language parser is nullpublic void addLanguages(Iterable<QueryParser> languages)
languages - the query parsers for the languages that are to be addedIllegalArgumentException - if the iterable reference is nullpublic QueryParser removeLanguage(String language)
language - the name of the language, which is to match the language of the parserIllegalArgumentException - if the language is nullpublic Collection<QueryParser> removeLanguages(String firstLanguage, String... additionalLanguages)
firstLanguage - the name of the first language to remove, which must match the language of the parseradditionalLanguages - the names of the additional languages to remove, which must match the
language of the parserIllegalArgumentException - if the language is nullpublic Set<String> getLanguages()
public QueryParser getParserFor(String language)
language - the language in which the query is expressed; must case-insensitively match one of the supported
languagesIllegalArgumentException - if the language is nullpublic QueryCommand parse(TypeSystem typeSystem, String language, String query)
typeSystem - the type system that should be usedlanguage - the language in which the query is expressed; must case-insensitively match one of the supported
languagesquery - the query that is to be executedIllegalArgumentException - if the language, context or query references are null, or if the language is not knownParsingException - if there is an error parsing the supplied queryInvalidQueryException - if the supplied query can be parsed but is invalidCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.