Package com.hp.hpl.jena.sparql.lang.sparql_10

Examples of com.hp.hpl.jena.sparql.lang.sparql_10.TokenMgrError


   
    // All throwable handling.
    private static void perform(Query query, String string, Action action)
    {
        Reader in = new StringReader(string) ;
        SPARQLParser10 parser = new SPARQLParser10(in) ;

        try {
            query.setStrict(true) ;
            parser.setQuery(query) ;
            action.exec(parser) ;
        }
        catch (com.hp.hpl.jena.sparql.lang.sparql_10.ParseException ex)
        {
            throw new QueryParseException(ex.getMessage(),
View Full Code Here


   
    // All throwable handling.
    private static void perform(Query query, String string, Action action)
    {
        Reader in = new StringReader(string) ;
        SPARQLParser10 parser = new SPARQLParser10(in) ;

        try {
            query.setStrict(true) ;
            parser.setQuery(query) ;
            action.exec(parser) ;
        }
        catch (com.hp.hpl.jena.sparql.lang.sparql_10.ParseException ex)
        {
            throw new QueryParseException(ex.getMessage(),
View Full Code Here

  }

  protected boolean dealWithThrowableFromQueryParser(final Throwable e,
      final EvaluationMode mode, final boolean queryOrRif) {
    if (e instanceof TokenMgrError) {
      final TokenMgrError tme = (TokenMgrError) e;
      this.displayErrorMessage(tme.getMessage(), false, queryOrRif);

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

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

        this.setErrorPosition(line, column, queryOrRif);
      }
      if (mode == EvaluationMode.DEMO) {
        this.enableOrDisableButtons(queryOrRif);
      }
      return true;
    } else  if (e instanceof lupos.rif.generated.parser.TokenMgrError) {
      final lupos.rif.generated.parser.TokenMgrError tme = (lupos.rif.generated.parser.TokenMgrError) e;
      this.displayErrorMessage(tme.getMessage(), false, queryOrRif);

      // create the pattern to match
      // and create a matcher against the string
      final Pattern pattern = Pattern
          .compile("line (\\d+), column (\\d+)");
      final Matcher matcher = pattern.matcher(tme.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

        line = pe.currentToken.next.beginLine;
        column = pe.currentToken.next.beginColumn;
      }
    }
    else if(t instanceof TokenMgrError) {
      TokenMgrError tme = (TokenMgrError) t;

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

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

TOP

Related Classes of com.hp.hpl.jena.sparql.lang.sparql_10.TokenMgrError

Copyright © 2018 www.massapicom. 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.