Package org.eclipse.persistence.jpa.internal.jpql.parser

Examples of org.eclipse.persistence.jpa.internal.jpql.parser.AbstractExpression


      if (expression.endsWithComma()) {
        complete = true;
      }

      int lastIndex = expression.childrenSize() - 1;
      AbstractExpression child = (AbstractExpression) expression.getChild(lastIndex);

      // The collection ends with an empty element, that's not complete
      if (isNull(child)) {
        complete = false;
      }
      else {
        int length = expression.toActualText(positionInCollections.peek()).length();

        // The position is at the beginning of the child expression, that means
        // it's complete because we don't have to verify the child expression
        if (corrections.peek() == length) {
          int index = Math.max(0, positionInCollections.peek() - 1);
          complete = expression.hasComma(index);
        }
        // Dig into the child expression to check its status
        else {
          child.accept(this);
        }
      }
    }
View Full Code Here


     * {@inheritDoc}
     */
    @Override
    public void visit(CollectionExpression expression) {
      int lastIndex = expression.childrenSize() - 1;
      AbstractExpression child = (AbstractExpression) expression.getChild(lastIndex);
      child.accept(this);
    }
View Full Code Here

    return bypassParentSubExpressionVisitor;
  }

  private int calculatePosition(Expression expression, int position) {

    AbstractExpression parent = (AbstractExpression) expression.getParent();

    // Reach the root
    if (parent == null) {
      return position;
    }

    // Traverse the expression until the expression
    for (Iterator<StringExpression> iter = parent.orderedChildren(); iter.hasNext(); ) {
      StringExpression childExpression = iter.next();

      // Continue to calculate the position by going up the hierarchy
      if (childExpression == expression) {
        return calculatePosition(parent, position);
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void visit(SubExpression expression) {
      if (expression.hasExpression()) {
        AbstractExpression childExpression = (AbstractExpression) expression.getExpression();
        validate(childExpression.getQueryBNF());
      }
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void visit(SubExpression expression) {
      if (expression.hasExpression()) {
        AbstractExpression childExpression = (AbstractExpression) expression.getExpression();
        validate(childExpression.getQueryBNF());
      }
    }
View Full Code Here

    return bypassParentSubExpressionVisitor;
  }

  private int calculatePosition(Expression expression, int position) {

    AbstractExpression parent = (AbstractExpression) expression.getParent();

    // Reach the root
    if (parent == null) {
      return position;
    }

    // Traverse the expression until the expression
    for (Iterator<StringExpression> iter = parent.orderedChildren(); iter.hasNext(); ) {
      StringExpression childExpression = iter.next();

      // Continue to calculate the position by going up the hierarchy
      if (childExpression == expression) {
        return calculatePosition(parent, position);
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void visit(CollectionExpression expression) {
      int lastIndex = expression.childrenSize() - 1;
      AbstractExpression child = (AbstractExpression) expression.getChild(lastIndex);
      child.accept(this);
    }
View Full Code Here

      if (expression.endsWithComma()) {
        complete = true;
      }

      int lastIndex = expression.childrenSize() - 1;
      AbstractExpression child = (AbstractExpression) expression.getChild(lastIndex);

      // The collection ends with an empty element, that's not complete
      if (isNull(child)) {
        complete = false;
      }
      else {
        int length = expression.toActualText(positionInCollections.peek()).length();

        // The position is at the beginning of the child expression, that means
        // it's complete because we don't have to verify the child expression
        if (corrections.peek() == length) {
          int index = Math.max(0, positionInCollections.peek() - 1);
          complete = expression.hasComma(index);
        }
        // Dig into the child expression to check its status
        else {
          child.accept(this);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jpa.internal.jpql.parser.AbstractExpression

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.