|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.query.parse.QueryParsers
@ThreadSafe public class QueryParsers
A thread-safe collection of QueryParser
implementations that can be used to parse queries by language.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public QueryParsers(QueryParser... parsers)
QueryParser
objects.
parsers
- the parserspublic QueryParsers(Iterable<QueryParser> parsers)
QueryParser
objects.
parsers
- the parsersMethod Detail |
---|
public void addLanguage(QueryParser languageParser)
languageParser
- the query parser for the language
IllegalArgumentException
- 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 languages
IllegalArgumentException
- if the language parser is nullpublic void addLanguages(Iterable<QueryParser> languages)
languages
- the query parsers for the languages that are to be added
IllegalArgumentException
- if the iterable reference is nullpublic QueryParser removeLanguage(String language)
language
- the name of the language, which is to match the language
of the parser
IllegalArgumentException
- 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 parser
IllegalArgumentException
- 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
languages
IllegalArgumentException
- 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
languages
query
- the query that is to be executed
IllegalArgumentException
- if the language, context or query references are null, or if the language is not known
ParsingException
- if there is an error parsing the supplied query
InvalidQueryException
- if the supplied query can be parsed but is invalidpublic int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |