Class AbstractScope
Object
gudusoft.gsqlparser.resolver2.scope.AbstractScope
- All Implemented Interfaces:
IScope
- Direct Known Subclasses:
DeleteScope,GlobalScope,GroupByScope,HavingScope,ListBasedScope,MergeScope,OraclePackageScope,OrderByScope,PlsqlBlockScope,SelectScope,UpdateScope
Abstract base class for all scopes.
Implements delegation pattern - most methods delegate to parent.
Subclasses only need to override methods where they have special behavior.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractScope(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)fullyQualify(String name) Default implementation: delegate to parentDefault implementation: empty listgetNode()Get the associated AST nodeGet the parent scope.Get the scope typeDefault implementation: delegate to parentbooleanDefault implementation: check ancestryvoidresolve(List<String> names, INameMatcher matcher, boolean deep, IResolved resolved) Default implementation: delegate to parentresolveTable(String tableName) Default implementation: delegate to parenttoString()
-
Field Details
-
parent
Parent scope (never null - root has EmptyScope parent) -
node
Associated AST node -
scopeType
Scope type
-
-
Constructor Details
-
AbstractScope
-
-
Method Details
-
getParent
Description copied from interface:IScopeGet the parent scope. Root scope (GlobalScope) has EmptyScope as parent. -
getNode
Description copied from interface:IScopeGet the associated AST node -
getScopeType
Description copied from interface:IScopeGet the scope type- Specified by:
getScopeTypein interfaceIScope- Returns:
- Scope type enum
-
resolve
Default implementation: delegate to parent -
resolveTable
Default implementation: delegate to parent- Specified by:
resolveTablein interfaceIScope- Parameters:
tableName- Table name or alias- Returns:
- Namespace if found, null otherwise
-
addChild
Default implementation: not supported (most scopes don't have children) -
getChildren
Default implementation: empty list- Specified by:
getChildrenin interfaceIScope- Returns:
- List of scope children
-
getVisibleNamespaces
Default implementation: delegate to parent- Specified by:
getVisibleNamespacesin interfaceIScope- Returns:
- List of visible namespaces
-
fullyQualify
Default implementation: delegate to parent- Specified by:
fullyQualifyin interfaceIScope- Parameters:
name- Name to qualify- Returns:
- Qualified name
-
isWithin
Default implementation: check ancestry -
toString
-