public final class RoutineRegistry extends Object
A declaration with the identity of an earlier one replaces it in place (CREATE OR REPLACE, a
package body after its specification). Lookups compare written names level by level
(RoutineName): the terminal through a per-kind index, the containers by their keys and states,
then the argument alias: a name-only lookup matches declarations keyed by name only, a lookup with
n arguments matches a declaration's total or input count. The result says how it matched and
whether it is unique (RoutineLookupResult); it never picks the first of several.
| Constructor and Description |
|---|
RoutineRegistry() |
| Modifier and Type | Method and Description |
|---|---|
RoutineDeclaration |
declare(RoutineDeclaration declaration)
Adds a declaration, or replaces the current occurrence of its identity; returns the declaration it
replaced, or null.
|
RoutineDeclaration |
find(RoutineDeclaration.Identity identity)
The current occurrence of an identity, or null.
|
List<RoutineDeclaration> |
getDeclarations() |
RoutineLookupResult |
lookup(List<RoutineName> interpretations,
Integer argumentCount)
Looks a routine up by the interpretations of its written name and, when the call site keys it with
one, the argument count (
null for a name-only lookup). |
RoutineLookupResult |
lookup(List<RoutineName> interpretations,
Integer argumentCount,
CatalogObjectKind wanted,
Collection<Object> visibleScopes)
A lookup for a routine of
wanted kind (ROUTINE when the call site does not say), seeing the local
routines declared in visibleScopes (the routines enclosing the call); triggers are not callable. |
public RoutineRegistry()
public RoutineDeclaration declare(RoutineDeclaration declaration)
public RoutineDeclaration find(RoutineDeclaration.Identity identity)
public List<RoutineDeclaration> getDeclarations()
public RoutineLookupResult lookup(List<RoutineName> interpretations, Integer argumentCount)
null for a name-only lookup).public RoutineLookupResult lookup(List<RoutineName> interpretations, Integer argumentCount, CatalogObjectKind wanted, Collection<Object> visibleScopes)
wanted kind (ROUTINE when the call site does not say), seeing the local
routines declared in visibleScopes (the routines enclosing the call); triggers are not callable.