Class ListBasedScope
Object
gudusoft.gsqlparser.resolver2.scope.AbstractScope
gudusoft.gsqlparser.resolver2.scope.ListBasedScope
- All Implemented Interfaces:
IScope
Base class for scopes that manage a list of child namespaces.
Used for FROM clauses, which contain multiple tables/subqueries.
Key features:
1. Maintains ordered list of children
2. Resolves names by searching through children
3. Supports aliases
-
Field Summary
FieldsFields inherited from class gudusoft.gsqlparser.resolver2.scope.AbstractScope
node, parent, scopeType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedListBasedScope(IScope parent, TParseTreeNode node, ScopeType scopeType) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(INamespace namespace, String alias, boolean nullable) Default implementation: not supported (most scopes don't have children)Default implementation: empty listDefault implementation: delegate to parentvoidresolve(List<String> names, INameMatcher matcher, boolean deep, IResolved resolved) Default implementation: delegate to parentprotected voidresolveInNamespace(INamespace namespace, boolean nullable, List<String> remainingNames, INameMatcher matcher, ResolvePath path, IResolved resolved) Resolve remaining name parts within a namespace.resolveTable(String tableName) Default implementation: delegate to parenttoString()Methods inherited from class gudusoft.gsqlparser.resolver2.scope.AbstractScope
fullyQualify, getNode, getParent, getScopeType, isWithin
-
Field Details
-
children
Child namespaces in this scope
-
-
Constructor Details
-
ListBasedScope
-
-
Method Details
-
addChild
Description copied from class:AbstractScopeDefault implementation: not supported (most scopes don't have children)- Specified by:
addChildin interfaceIScope- Overrides:
addChildin classAbstractScope- Parameters:
namespace- The namespace to addalias- The alias for this namespacenullable- Whether this namespace is nullable (e.g., RIGHT side of LEFT JOIN)
-
getChildren
Description copied from class:AbstractScopeDefault implementation: empty list- Specified by:
getChildrenin interfaceIScope- Overrides:
getChildrenin classAbstractScope- Returns:
- List of scope children
-
resolveTable
Description copied from class:AbstractScopeDefault implementation: delegate to parent- Specified by:
resolveTablein interfaceIScope- Overrides:
resolveTablein classAbstractScope- Parameters:
tableName- Table name or alias- Returns:
- Namespace if found, null otherwise
-
resolve
Description copied from class:AbstractScopeDefault implementation: delegate to parent- Specified by:
resolvein interfaceIScope- Overrides:
resolvein classAbstractScope- Parameters:
names- Name parts (e.g., ["schema", "table", "column"])matcher- Name matcher for case sensitivity rulesdeep- Whether to recursively resolve into record fieldsresolved- Callback to collect all matches
-
resolveInNamespace
protected void resolveInNamespace(INamespace namespace, boolean nullable, List<String> remainingNames, INameMatcher matcher, ResolvePath path, IResolved resolved) Resolve remaining name parts within a namespace. For example, if we found table "t" and need to resolve "t.col1", this method handles resolving "col1" within table t. -
getVisibleNamespaces
Description copied from class:AbstractScopeDefault implementation: delegate to parent- Specified by:
getVisibleNamespacesin interfaceIScope- Overrides:
getVisibleNamespacesin classAbstractScope- Returns:
- List of visible namespaces
-
toString
- Overrides:
toStringin classAbstractScope
-