ClassLoader
class in package klyn

    public abstract class ClassLoader:

ClassLoader

Class loader abstraction.

The runtime exposes a system loader responsible for resolving classes and packages.

Class search order is fixed by the runtime for predictability and security: first the standard library located under `$KLYN_HOME/lib`, then the directory containing the startup `.kn` file, then the entries declared with `-kp` or `--klasspath`, then the entries declared in `$KLASSPATH`, and finally the current working directory if it is distinct from the startup directory. Standard library classes therefore cannot be shadowed by local application files.

Properties

Modifier and Type | Member | Description
--- | --- | ---
public static readonly property | system `system as SystemClassLoader:` | Returns the system class loader of the current runtime.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public static native | addSourceRoot `addSourceRoot(path as String) as Boolean throws IOException` | Adds a source root to the active runtime class path.
public static | forName `forName(name as String) as Type:` | Loads a class by its fully qualified name using the system loader.
public static native | getSystem `getSystem() as SystemClassLoader` | Returns the runtime system class loader.
public static native | getTypeByName `getTypeByName(name as String) as Type` | Resolves a type by name using the runtime facilities.
public abstract | loadClass `loadClass(name as String) as Type` | Loads a class by name and returns its Type.
public static native | loadObjectBundle `loadObjectBundle( objectFilenames as ArrayList<String>, sourceFilenames as ArrayList<String>, typeName as String ) as Type throws Exception` | Loads a platform-native Klyn object bundle into the active JIT.
public abstract | loadPackage `loadPackage(name as String) as Void` | Loads a package by name (if supported by the runtime).
public static native | loadSourceClass `loadSourceClass(sourceFilename as String, typeName as String) as Type throws Exception` | Compiles or reuses a cached Klyn source object, loads it into the active JIT and returns its declared entry type.
public static native | objectAbiVersion `objectAbiVersion() as Long` | Returns the native object ABI expected by the current compiler/runtime.