Class DefaultResourceFactory

java.lang.Object
nz.org.riskscape.engine.resource.DefaultResourceFactory
All Implemented Interfaces:
nz.org.riskscape.engine.resource.ResourceFactory

public class DefaultResourceFactory extends Object implements nz.org.riskscape.engine.resource.ResourceFactory

Factory of Resources.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
    DefaultResourceFactory(nz.org.riskscape.engine.resource.ResourceLoader... loaders)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(nz.org.riskscape.engine.resource.ResourceLoader loader)
    Add a ResourceLoader to this factory.
    nz.org.riskscape.engine.resource.CreateHandle
    create(nz.org.riskscape.engine.resource.CreateRequest request)
     
    List<nz.org.riskscape.engine.resource.ResourceLoader>
     
    nz.org.riskscape.engine.resource.Resource
    load(@NonNull String target, @NonNull URI relativeTo)
    Loads the resource pointed to by target and return the Resource along with any problems encountered.
    nz.org.riskscape.engine.resource.Resource
    load(@NonNull URI target)
    Loads the resource pointed to by target and return the Resource along with any problems encountered.
    nz.org.riskscape.engine.resource.Resource
    load(@NonNull URI target, @NonNull URI relativeTo)
    Loads the resource pointed to by target and return the Resource along with any problems encountered.

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface nz.org.riskscape.engine.resource.ResourceFactory

    create
  • Constructor Details

    • DefaultResourceFactory

      public DefaultResourceFactory()
    • DefaultResourceFactory

      public DefaultResourceFactory(nz.org.riskscape.engine.resource.ResourceLoader... loaders)
  • Method Details

    • load

      public nz.org.riskscape.engine.resource.Resource load(@NonNull @NonNull String target, @NonNull @NonNull URI relativeTo) throws nz.org.riskscape.engine.resource.ResourceLoadingException

      Loads the resource pointed to by target and return the Resource along with any problems encountered.

      Specified by:
      load in interface nz.org.riskscape.engine.resource.ResourceFactory
      Parameters:
      target - to load
      relativeTo - URI to resolve relative targets against
      Returns:
      resource and/or problems encountered
      Throws:
      nz.org.riskscape.engine.resource.ResourceLoadingException
    • load

      public nz.org.riskscape.engine.resource.Resource load(@NonNull @NonNull URI target, @NonNull @NonNull URI relativeTo) throws nz.org.riskscape.engine.resource.ResourceLoadingException

      Loads the resource pointed to by target and return the Resource along with any problems encountered.

      Specified by:
      load in interface nz.org.riskscape.engine.resource.ResourceFactory
      Parameters:
      target - to load
      relativeTo - URI to resolve relative targets against
      Returns:
      resource and/or problems encountered
      Throws:
      nz.org.riskscape.engine.resource.ResourceLoadingException
    • load

      public nz.org.riskscape.engine.resource.Resource load(@NonNull @NonNull URI target) throws nz.org.riskscape.engine.resource.ResourceLoadingException

      Loads the resource pointed to by target and return the Resource along with any problems encountered.

      Specified by:
      load in interface nz.org.riskscape.engine.resource.ResourceFactory
      Parameters:
      target - to load
      Returns:
      resource and/or problems encountered
      Throws:
      nz.org.riskscape.engine.resource.ResourceLoadingException
    • add

      public void add(nz.org.riskscape.engine.resource.ResourceLoader loader)

      Add a ResourceLoader to this factory.

      Specified by:
      add in interface nz.org.riskscape.engine.resource.ResourceFactory
      Parameters:
      loader -
    • create

      public nz.org.riskscape.engine.resource.CreateHandle create(nz.org.riskscape.engine.resource.CreateRequest request)
      Specified by:
      create in interface nz.org.riskscape.engine.resource.ResourceFactory
    • getLoaders

      public List<nz.org.riskscape.engine.resource.ResourceLoader> getLoaders()
      Specified by:
      getLoaders in interface nz.org.riskscape.engine.resource.ResourceFactory