net.sf.saffron.sql
Class SqlValidator.SelectScope

java.lang.Object
  |
  +--net.sf.saffron.sql.SqlValidator.Scope
        |
        +--net.sf.saffron.sql.SqlValidator.SelectScope
Enclosing class:
SqlValidator

public class SqlValidator.SelectScope
extends SqlValidator.Scope

The name-resolution scope of a SELECT clause. The objects visible are those in the FROM clause, and objects inherited from the parent scope.


Field Summary
private  ArrayList children
          List of child scopes, set on validate.
private  ArrayList childrenNames
          Aliases of the child scopes, set on validate.
private  SaffronType rowType
          Type of the output row, which comprises the name and type of each output column.
 SqlSelect select
           
private  int validateCount
           
 
Fields inherited from class net.sf.saffron.sql.SqlValidator.Scope
parent
 
Constructor Summary
(package private) SqlValidator.SelectScope(SqlValidator.Scope parent, SqlSelect select, String alias)
           
 
Method Summary
protected  String findQualifyingTableName(String columnName)
           
private  SqlValidator.Scope getChild(String alias)
           
(package private)  SqlNode getNode()
           
 SaffronType getRowType()
          Returns a list of names of output columns.
 SqlValidator.Scope resolve(String name, SqlValidator.Scope[] ancestorOut, int[] offsetOut)
          Looks up a node with a given name.
 SaffronType resolveColumn(String name)
           
 void validate()
           
 
Methods inherited from class net.sf.saffron.sql.SqlValidator.Scope
deriveAlias, fullyQualify, getAlias, getScopeFromNode, getTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

validateCount

private int validateCount

select

public final SqlSelect select

children

private final ArrayList children
List of child scopes, set on validate.


childrenNames

private final ArrayList childrenNames
Aliases of the child scopes, set on validate.


rowType

private SaffronType rowType
Type of the output row, which comprises the name and type of each output column. Set on validate.

Constructor Detail

SqlValidator.SelectScope

SqlValidator.SelectScope(SqlValidator.Scope parent,
                         SqlSelect select,
                         String alias)
Method Detail

findQualifyingTableName

protected String findQualifyingTableName(String columnName)
Overrides:
findQualifyingTableName in class SqlValidator.Scope

getRowType

public SaffronType getRowType()
Description copied from class: SqlValidator.Scope
Returns a list of names of output columns.

Specified by:
getRowType in class SqlValidator.Scope

validate

public void validate()
Overrides:
validate in class SqlValidator.Scope

getNode

SqlNode getNode()
Specified by:
getNode in class SqlValidator.Scope

getChild

private SqlValidator.Scope getChild(String alias)

resolve

public SqlValidator.Scope resolve(String name,
                                  SqlValidator.Scope[] ancestorOut,
                                  int[] offsetOut)
Description copied from class: SqlValidator.Scope
Looks up a node with a given name. Returns null if none is found.

Overrides:
resolve in class SqlValidator.Scope
Parameters:
name - Name of node to find
ancestorOut - If not null, writes the ancestor scope here
offsetOut - If not null, writes the offset within the ancestor here

resolveColumn

public SaffronType resolveColumn(String name)

SourceForge.net_Logo