Examples of QueryParseException


Examples of com.caucho.amber.query.QueryParseException

    throws QueryParseException
  {
    if (isBoolean())
      return this;
    else
      throw new QueryParseException(L.l("'{0}' can't be used as a boolean",
                                        this));
  }
View Full Code Here

Examples of com.google.gerrit.server.query.QueryParseException

    if (!(s instanceof ChangeDataSource)) {
      s = queryRewriter.rewrite(Predicate.and(queryBuilder.status_open(), q));
    }

    if (!(s instanceof ChangeDataSource)) {
      throw new QueryParseException("invalid query: " + s);
    }

    return s;
  }
View Full Code Here

Examples of com.google.gerrit.server.query.QueryParseException

  }

  public void query(Writer out)
      throws OrmException, QueryParseException, IOException {
    if (imp.isDisabled()) {
      throw new QueryParseException("query disabled");
    }
    if (queries == null || queries.isEmpty()) {
      queries = Collections.singletonList("status:open");
    } else if (queries.size() > 10) {
      // Hard-code a default maximum number of queries to prevent
      // users from submitting too much to the server in a single call.
      throw new QueryParseException("limit of 10 queries");
    }

    List<List<ChangeInfo>> res = Lists.newArrayListWithCapacity(queries.size());
    for (String query : queries) {
      List<ChangeData> changes = imp.queryChanges(query);
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

            ARQParser parser = new ARQParser(in) ;
            parser.setQuery(query) ;
            return parser.Expression() ;
        }
        catch (com.hp.hpl.jena.sparql.lang.arq.ParseException ex)
        { throw new QueryParseException(ex.getMessage(), ex.currentToken.beginLine, ex.currentToken.beginColumn) ; }
        catch (com.hp.hpl.jena.sparql.lang.arq.TokenMgrError tErr)
        { throw new QueryParseException(tErr.getMessage(),-1,-1) ; }
        catch (Error err)
        {
            String tmp = err.getMessage() ;
            if ( tmp == null )
                throw new QueryParseException(err,-1, -1) ;
            throw new QueryParseException(tmp,-1, -1) ;
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

      if (mode == EvaluationMode.DEMO) {
        this.enableOrDisableButtons(queryOrRif);
      }
      return true;
    } else if (e instanceof QueryParseException) {
      final QueryParseException qpe = (QueryParseException) e;
      this.displayErrorMessage(qpe.getMessage(), false, queryOrRif);

      // create the pattern to match
      // and create a matcher against the string
      final Pattern pattern = Pattern.compile(
          "line (\\d+), column (\\d+)", Pattern.CASE_INSENSITIVE);
      final Matcher matcher = pattern.matcher(qpe.getMessage());

      // try to find the pattern in the message...
      if (matcher.find() == true) {
        // get matches...
        final int line = Integer.parseInt(matcher.group(1));
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

       
        if ( currentColumn+1 != variables.size() )
        {
            String msg = String.format("Mismatch: %d variables but %d values",variables.size(), currentColumn+1) ;
            msg = QueryParseException.formatMessage(msg, line, col) ;
            throw new QueryParseException(msg, line , col) ;
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

            parser.setQuery(query) ;
            action.exec(parser) ;
        }
        catch (com.hp.hpl.jena.sparql.lang.sparql_10.ParseException ex)
        {
            throw new QueryParseException(ex.getMessage(),
                                          ex.currentToken.beginLine,
                                          ex.currentToken.beginColumn
                                          ) ; }
        catch (com.hp.hpl.jena.sparql.lang.sparql_10.TokenMgrError tErr)
        {
            // Last valid token : not the same as token error message - but this should not happen
            int col = parser.token.endColumn ;
            int line = parser.token.endLine ;
            throw new QueryParseException(tErr.getMessage(), line, col) ; }
       
        catch (QueryException ex) { throw ex ; }
        catch (JenaException ex)  { throw new QueryException(ex.getMessage(), ex) ; }
        catch (Error err)
        {
            // The token stream can throw errors.
            throw new QueryParseException(err.getMessage(), err, -1, -1) ;
        }
        catch (Throwable th)
        {
            Log.warn(ParserSPARQL10.class, "Unexpected throwable: ",th) ;
            throw new QueryException(th.getMessage(), th) ;
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

            parser.setQuery(query) ;
            action.exec(parser) ;
        }
        catch (com.hp.hpl.jena.sparql.lang.arq.ParseException ex)
        {
            throw new QueryParseException(ex.getMessage(),
                                          ex.currentToken.beginLine,
                                          ex.currentToken.beginColumn
                                          ) ; }
        catch (com.hp.hpl.jena.sparql.lang.arq.TokenMgrError tErr)
        {
            // Last valid token : not the same as token error message - but this should not happen
            int col = parser.token.endColumn ;
            int line = parser.token.endLine ;
            throw new QueryParseException(tErr.getMessage(), line, col) ; }
       
        catch (QueryException ex) { throw ex ; }
        catch (JenaException ex)  { throw new QueryException(ex.getMessage(), ex) ; }
        catch (Error err)
        {
            // The token stream can throw errors.
            throw new QueryParseException(err.getMessage(), err, -1, -1) ;
        }
        catch (Throwable th)
        {
            Log.warn(ParserSPARQL11.class, "Unexpected throwable: ",th) ;
            throw new QueryException(th.getMessage(), th) ;
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

       
        if ( currentColumn+1 != variables.size() )
        {
            String msg = String.format("Mismatch: %d variables but %d values",variables.size(), currentColumn+1) ;
            msg = QueryParseException.formatMessage(msg, line, col) ;
            throw new QueryParseException(msg, line , col) ;
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

            try {
                // Possible too large for a long.
                BigInteger integer = new BigInteger(s) ;
                throwParseException("Number '"+s+"' is a valid number but can't not be stored in a long") ;
            } catch (NumberFormatException ex2) {}
            throw new QueryParseException(ex, -1, -1) ;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.