Package nz.org.riskscape.engine.resource
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 Resource
s.
-
Constructor Summary
ConstructorDescriptionDefaultResourceFactory
(nz.org.riskscape.engine.resource.ResourceLoader... loaders) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(nz.org.riskscape.engine.resource.ResourceLoader loader) Add aResourceLoader
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
Loads the resource pointed to by target and return theResource
along with any problems encountered.nz.org.riskscape.engine.resource.Resource
Loads the resource pointed to by target and return theResource
along with any problems encountered.nz.org.riskscape.engine.resource.Resource
Loads the resource pointed to by target and return theResource
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 interfacenz.org.riskscape.engine.resource.ResourceFactory
- Parameters:
target
- to loadrelativeTo
- 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 interfacenz.org.riskscape.engine.resource.ResourceFactory
- Parameters:
target
- to loadrelativeTo
- 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 interfacenz.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 interfacenz.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 interfacenz.org.riskscape.engine.resource.ResourceFactory
-
getLoaders
- Specified by:
getLoaders
in interfacenz.org.riskscape.engine.resource.ResourceFactory
-