@agentix-e/spel-ts - v2.0.2
    Preparing search index...

    Class StandardTypeLocator

    Parallels Spring StandardTypeLocator.

    Resolves the names used by T(...), instanceof and new ....

    Two behaviours matter and both mirror Spring:

    • java.lang is imported implicitly, so T(String) and T(java.lang.String) are the same type. An unqualified name that is not found is retried with each registered prefix.
    • The catalogue of available types is explicit (see java-types.ts). Where Spring consults a class loader, this port has a registry, so a type that is not registered raises TYPE_NOT_FOUND rather than being loaded on demand.

    Implements

    Index
    • Convenience: register a JavaScript constructor as a type. Automatically creates a TypeDescriptor wrapping the constructor.

      Parameters

      • name: string
      • constructor: new (...args: unknown[]) => unknown
      • staticMethods: Record<string, (...args: unknown[]) => unknown> = {}
      • staticFields: Record<string, unknown> = {}

      Returns void

    • Add a package prefix for unqualified names, mirroring Spring's registerImport.

      Parameters

      • prefix: string

      Returns void