Package com.io7m.cedarbridge.schema.compiler.internal

# Class CBLoader

java.lang.Object
com.io7m.cedarbridge.schema.compiler.internal.CBLoader

All Implemented Interfaces:
  `CBLoaderType`, `Closeable`, `AutoCloseable`

public final class CBLoader extends Object implements CBLoaderType
The default loader implementation.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CBLoader(CBSchemaCompilerInternalFactory internalFactory, List<Path> inIncludePaths, Consumer<CBError> inErrors)`
  The default loader implementation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `CBPackageType`
  `load(String from, String name)`
  Load a package.
  `void`
  `register(CBPackageType pack)`
  Register a package, making it available for loading.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CBLoader

    public CBLoader(CBSchemaCompilerInternalFactory internalFactory, List<Path> inIncludePaths, Consumer<CBError> inErrors)
    The default loader implementation.
    Parameters:
      `inErrors` - An error consumer
      `inIncludePaths` - The list of include paths
      `internalFactory` - An internal compiler factory

- ## Method Details

  - ### register

    public void register(CBPackageType pack)
    Description copied from interface: `CBLoaderType`
    Register a package, making it available for loading.
    Specified by:
      `register` in interface `CBLoaderType`
    Parameters:
      `pack` - The package

  - ### load

    public CBPackageType load(String from, String name) throws CBLoadFailedException
    Description copied from interface: `CBLoaderType`
    Load a package.
    Specified by:
      `load` in interface `CBLoaderType`
    Parameters:
      `from` - The requesting package
      `name` - The target package
    Returns:
      A loaded package
    Throws:
      `CBLoadFailedException` - On errors

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`