Examples of ASTIterator


Examples of org.hibernate.hql.internal.ast.util.ASTIterator

    if ( fromElement.getQueryableCollection() != null && fromElement.isFetch() ) {
      text = fromElement.renderCollectionSelectFragment( nonscalarSize, k );
      appender.append( SqlTokenTypes.SQL_TOKEN, text, false );
    }
    // Look through the FromElement's children to find any collections of values that should be fetched...
    ASTIterator iter = new ASTIterator( fromElement );
    while ( iter.hasNext() ) {
      FromElement child = ( FromElement ) iter.next();
      if ( child.isCollectionOfValuesOrComponents() && child.isFetch() ) {
        // Need a better way to define the suffixes here...
        text = child.renderValueCollectionSelectFragment( nonscalarSize, nonscalarSize + k );
        appender.append( SqlTokenTypes.SQL_TOKEN, text, false );
      }
View Full Code Here

Examples of org.hibernate.hql.internal.ast.util.ASTIterator

    return fromElementCounter++;
  }

  public void resolve() {
    // Make sure that all from elements registered with this FROM clause are actually in the AST.
    ASTIterator iter = new ASTIterator( this.getFirstChild() );
    Set childrenInTree = new HashSet();
    while ( iter.hasNext() ) {
      childrenInTree.add( iter.next() );
    }
    for ( Iterator iterator = fromElements.iterator(); iterator.hasNext(); ) {
      FromElement fromElement = ( FromElement ) iterator.next();
      if ( !childrenInTree.contains( fromElement ) ) {
        throw new IllegalStateException( "Element not in AST: " + fromElement );
View Full Code Here

Examples of org.hibernate.hql.internal.ast.util.ASTIterator

    if ( fromElement.getQueryableCollection() != null && fromElement.isFetch() ) {
      text = fromElement.renderCollectionSelectFragment( nonscalarSize, k );
      appender.append( SqlTokenTypes.SQL_TOKEN, text, false );
    }
    // Look through the FromElement's children to find any collections of values that should be fetched...
    ASTIterator iter = new ASTIterator( fromElement );
    while ( iter.hasNext() ) {
      FromElement child = ( FromElement ) iter.next();
      if ( child.isCollectionOfValuesOrComponents() && child.isFetch() ) {
        // Need a better way to define the suffixes here...
        text = child.renderValueCollectionSelectFragment( nonscalarSize, nonscalarSize + k );
        appender.append( SqlTokenTypes.SQL_TOKEN, text, false );
      }
View Full Code Here

Examples of org.hibernate.hql.internal.ast.util.ASTIterator

    if ( fromElement.getQueryableCollection() != null && fromElement.isFetch() ) {
      text = fromElement.renderCollectionSelectFragment( nonscalarSize, k );
      appender.append( SqlTokenTypes.SQL_TOKEN, text, false );
    }
    // Look through the FromElement's children to find any collections of values that should be fetched...
    ASTIterator iter = new ASTIterator( fromElement );
    while ( iter.hasNext() ) {
      FromElement child = ( FromElement ) iter.next();
      if ( child.isCollectionOfValuesOrComponents() && child.isFetch() ) {
        // Need a better way to define the suffixes here...
        text = child.renderValueCollectionSelectFragment( nonscalarSize, nonscalarSize + k );
        appender.append( SqlTokenTypes.SQL_TOKEN, text, false );
      }
View Full Code Here

Examples of org.hibernate.hql.internal.ast.util.ASTIterator

    if ( fromElement.getQueryableCollection() != null && fromElement.isFetch() ) {
      text = fromElement.renderCollectionSelectFragment( nonscalarSize, k );
      appender.append( SqlTokenTypes.SQL_TOKEN, text, false );
    }
    // Look through the FromElement's children to find any collections of values that should be fetched...
    ASTIterator iter = new ASTIterator( fromElement );
    while ( iter.hasNext() ) {
      FromElement child = ( FromElement ) iter.next();
      if ( child.isCollectionOfValuesOrComponents() && child.isFetch() ) {
        // Need a better way to define the suffixes here...
        text = child.renderValueCollectionSelectFragment( nonscalarSize, nonscalarSize + k );
        appender.append( SqlTokenTypes.SQL_TOKEN, text, false );
      }
View Full Code Here

Examples of org.mvel2.util.ASTIterator

  private static final class DecompileContext {
    public int node = 0;
  }

  private static String decompile(CompiledExpression cExp, boolean nest, DecompileContext context) {
    ASTIterator iter = new ASTLinkedList(cExp.getFirstNode());
    ASTNode tk;

    StringBuffer sbuf = new StringBuffer();

    if (!nest) {
      sbuf.append("Expression Decompile\n-------------\n");
    }

    while (iter.hasMoreNodes()) {
      sbuf.append("(").append(context.node++).append(") ");

      if ((tk = iter.nextNode()) instanceof NestedStatement
          && ((NestedStatement) tk).getNestedStatement() instanceof CompiledExpression) {
        //noinspection StringConcatenationInsideStringBufferAppend
        sbuf.append("NEST [" + tk.getClass().getSimpleName() + "]: { " + tk.getName() + " }\n");
        sbuf.append(decompile((CompiledExpression) ((NestedStatement) tk).getNestedStatement(), true, context));
      }
View Full Code Here

Examples of org.mvel2.util.ASTIterator

    return "UNKNOWN_OPERATOR";
  }

  public static Class determineType(String name, CompiledExpression compiledExpression) {
    ASTIterator iter = new ASTLinkedList(compiledExpression.getFirstNode());
    ASTNode node;
    while (iter.hasMoreNodes()) {
      if (name.equals((node = iter.nextNode()).getName()) && node.isAssignment()) {
        return node.getEgressType();
      }
    }

    return null;
View Full Code Here

Examples of org.mvel2.util.ASTIterator

  private static final class DecompileContext {
    public int node = 0;
  }

  private static String decompile(CompiledExpression cExp, boolean nest, DecompileContext context) {
    ASTIterator iter = new ASTLinkedList(cExp.getFirstNode());
    ASTNode tk;

    StringBuffer sbuf = new StringBuffer();

    if (!nest) {
      sbuf.append("Expression Decompile\n-------------\n");
    }

    while (iter.hasMoreNodes()) {
      sbuf.append("(").append(context.node++).append(") ");

      if ((tk = iter.nextNode()) instanceof NestedStatement
          && ((NestedStatement) tk).getNestedStatement() instanceof CompiledExpression) {
        //noinspection StringConcatenationInsideStringBufferAppend
        sbuf.append("NEST [" + tk.getClass().getSimpleName() + "]: { " + tk.getName() + " }\n");
        sbuf.append(decompile((CompiledExpression) ((NestedStatement) tk).getNestedStatement(), true, context));
      }
View Full Code Here

Examples of org.mvel2.util.ASTIterator

    return "UNKNOWN_OPERATOR";
  }

  public static Class determineType(String name, CompiledExpression compiledExpression) {
    ASTIterator iter = new ASTLinkedList(compiledExpression.getFirstNode());
    ASTNode node;
    while (iter.hasMoreNodes()) {
      if (name.equals((node = iter.nextNode()).getName()) && node.isAssignment()) {
        return node.getEgressType();
      }
    }

    return null;
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.