Interface ILoader<T>

Type Parameters:
T - the type of resource loaded by this loader
All Known Subinterfaces:
IBindingModuleLoader, IConstraintLoader, IModuleLoader<M>
All Known Implementing Classes:
AbstractLoader, AbstractModuleLoader, BindingConstraintLoader, BindingModuleLoader

public interface ILoader<T>
Provides loading capabilities for resources of type T.

Supports loading from various sources including URIs, paths, files, and URLs.

  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieve the set of loaded resources.
    default T
    load(File file)
    Load a resource from the specified file.
    load(URI resource)
    Load a resource from the specified URI.
    load(URL url)
    Loads a resource from the specified URL.
    load(Path path)
    Load a resource from the specified path.
  • Method Details

    • getLoadedResources

      @NonNull Collection<T> getLoadedResources()
      Retrieve the set of loaded resources.
      Returns:
      the set of loaded resources
    • load

      @NonNull T load(@NonNull URI resource) throws MetaschemaException, IOException
      Load a resource from the specified URI.
      Parameters:
      resource - the resource to load
      Returns:
      the loaded instance for the specified resource
      Throws:
      MetaschemaException - if an error occurred while processing the resource
      IOException - if an error occurred parsing the resource
    • load

      @NonNull T load(@NonNull Path path) throws MetaschemaException, IOException
      Load a resource from the specified path.
      Parameters:
      path - the resource to load
      Returns:
      the loaded instance for the specified resource
      Throws:
      MetaschemaException - if an error occurred while processing the resource
      IOException - if an error occurred parsing the resource
    • load

      @NonNull default T load(@NonNull File file) throws MetaschemaException, IOException
      Load a resource from the specified file.
      Parameters:
      file - the resource to load
      Returns:
      the loaded instance for the specified resource
      Throws:
      MetaschemaException - if an error occurred while processing the resource
      IOException - if an error occurred parsing the resource
    • load

      @NonNull T load(@NonNull URL url) throws MetaschemaException, IOException
      Loads a resource from the specified URL.
      Parameters:
      url - the URL to load the resource from
      Returns:
      the loaded instance for the specified resource
      Throws:
      MetaschemaException - if an error occurred while processing the resource
      IOException - if an error occurred parsing the resource