public org.modeshape.jcr.api.query.Query createQuery( String expression,
String language,
Path storedAtPath ) throws InvalidQueryException, RepositoryException {
session.checkLive();
// Look for a parser for the specified language ...
QueryParsers queryParsers = session.repository().runningState().queryParsers();
QueryParser parser = queryParsers.getParserFor(language);
if (parser == null) {
Set<String> languages = queryParsers.getLanguages();
throw new InvalidQueryException(JcrI18n.invalidQueryLanguage.text(language, languages));
}
try {
// Parsing must be done now ...
QueryCommand command = parser.parseQuery(expression, typeSystem);