FileDocCategorySizeDatePackage
SelectExpressionList.javaAPI DocHibernate 3.2.51727Tue Jul 12 15:27:30 BST 2005org.hibernate.hql.ast.tree

SelectExpressionList

public abstract class SelectExpressionList extends HqlSqlWalkerNode
Common behavior - a node that contains a list of select expressions.
author
josh Nov 6, 2004 8:51:00 AM

Fields Summary
Constructors Summary
Methods Summary
public SelectExpression[]collectSelectExpressions()
Returns an array of SelectExpressions gathered from the children of the given parent AST node.

return
an array of SelectExpressions gathered from the children of the given parent AST node.

		// Get the first child to be considered.  Sub-classes may do this differently in order to skip nodes that
		// are not select expressions (e.g. DISTINCT).
		AST firstChild = getFirstSelectExpression();
		AST parent = this;
		ArrayList list = new ArrayList( parent.getNumberOfChildren() );
		for ( AST n = firstChild; n != null; n = n.getNextSibling() ) {
			if ( n instanceof SelectExpression ) {
				list.add( n );
			}
			else {
				throw new IllegalStateException( "Unexpected AST: " + n.getClass().getName() + " " + new ASTPrinter( SqlTokenTypes.class ).showAsString( n, "" ) );
			}
		}
		return ( SelectExpression[] ) list.toArray( new SelectExpression[list.size()] );
	
protected abstract antlr.collections.ASTgetFirstSelectExpression()
Returns the first select expression node that should be considered when building the array of select expressions.

return
the first select expression node that should be considered when building the array of select expressions