Package org.openrdf.query.parser.serql.ast

Examples of org.openrdf.query.parser.serql.ast.VisitorException


  @Override
  public Object visit(ASTNull node, Object data)
    throws VisitorException
  {
    throw new VisitorException(
        "Use of NULL values in SeRQL queries has been deprecated, use BOUND(...) instead");
  }
View Full Code Here


      if (alias != null) {
        boolean isUnique = aliases.add(alias);

        if (!isUnique) {
          throw new VisitorException("Duplicate projection element names: '" + alias + "'");
        }
      }
      else {
        unaliasedNodes.add(projElem);
      }
View Full Code Here

          if (iter.hasNext()) {
            errMsg.append(", ");
          }
        }

        throw new VisitorException(errMsg.toString());
      }
    }

    return data;
  }
View Full Code Here

        value = SeRQLUtil.decodeString(value);
        stringNode.setValue(value);
      }
      catch (IllegalArgumentException e) {
        // Invalid escape sequence
        throw new VisitorException(e.getMessage());
      }

      return super.visit(stringNode, data);
    }
View Full Code Here

        label = SeRQLUtil.decodeString(label);
        literalNode.setLabel(label);
      }
      catch (IllegalArgumentException e) {
        // Invalid escape sequence
        throw new VisitorException(e.getMessage());
      }

      return super.visit(literalNode, data);
    }
View Full Code Here

  @Override
  public Object visit(ASTNull node, Object data)
    throws VisitorException
  {
    throw new VisitorException(
        "Use of NULL values in SeRQL queries has been deprecated, use BOUND(...) instead");
  }
View Full Code Here

      String prefix = qname.substring(0, colonIdx);
      String localName = qname.substring(colonIdx + 1);

      String namespace = prefixMap.get(prefix);
      if (namespace == null) {
        throw new VisitorException("QName '" + qname + "' uses an undefined prefix");
      }

      // Replace the qname node with a new IRI node in the parent node
      ASTURI uriNode = new ASTURI(SyntaxTreeBuilderTreeConstants.JJTURI);
      uriNode.setValue(namespace + localName);
View Full Code Here

          case NE:
            logger.warn("Use of NULL values in SeRQL queries has been deprecated, use BOUND(...) instead");
            compareNode.jjtReplaceWith(new ASTBooleanConstant(false));
            break;
          default:
            throw new VisitorException(
                "Use of NULL values in SeRQL queries has been deprecated, use BOUND(...) instead");
        }
      }
      else if (leftIsNull || rightIsNull) {
        ASTValueExpr valueOperand;
        if (leftIsNull) {
          valueOperand = compareNode.getRightOperand();
        }
        else {
          valueOperand = compareNode.getLeftOperand();
        }

        if (valueOperand instanceof ASTVar && operator == EQ || operator == NE) {
          ASTBooleanExpr replacementNode = new ASTBound(valueOperand);

          if (operator == EQ) {
            replacementNode = new ASTNot(replacementNode);
          }

          compareNode.jjtReplaceWith(replacementNode);

          return null;
        }

        throw new VisitorException(
            "Use of NULL values in SeRQL queries has been deprecated, use BOUND(...) instead");
      }

      return null;
    }
View Full Code Here

    @Override
    public Object visit(ASTNull nullNode, Object data)
      throws VisitorException
    {
      throw new VisitorException(
          "Use of NULL values in SeRQL queries has been deprecated, use BOUND(...) instead");
    }
View Full Code Here

        String alias = (String)result;

        boolean isUnique = aliases.add(alias);

        if (!isUnique) {
          throw new VisitorException("Duplicate projection element aliases: '" + alias + "'");
        }
      }
      else {
        unaliasedNodes.add(projElem);
      }
View Full Code Here

TOP

Related Classes of org.openrdf.query.parser.serql.ast.VisitorException

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.