public class BaseModelLoader extends java.lang.Object implements ModelLoader
ModelLoader
implementations.Modifier and Type | Field and Description |
---|---|
protected TranslatorFactory |
defaultFactory |
protected MRL |
mrl |
Constructor and Description |
---|
BaseModelLoader(MRL mrl)
Constructs a
ModelLoader given the repository, mrl, and version. |
Modifier and Type | Method and Description |
---|---|
protected Model |
createModel(java.nio.file.Path modelPath,
java.lang.String name,
Device device,
Block block,
java.util.Map<java.lang.String,java.lang.Object> arguments,
java.lang.String engine) |
Application |
getApplication()
Returns the application of the
ModelLoader . |
java.lang.String |
getArtifactId()
Returns the artifact ID of the
ModelLoader . |
protected TranslatorFactory |
getTranslatorFactory(Criteria<?,?> criteria,
java.util.Map<java.lang.String,java.lang.Object> arguments) |
java.util.List<Artifact> |
listModels()
Returns a list of the available artifacts that can be loaded.
|
<I,O> ZooModel<I,O> |
loadModel(Criteria<I,O> criteria)
Loads the model with the given criteria.
|
java.lang.String |
toString() |
protected MRL mrl
protected TranslatorFactory defaultFactory
public BaseModelLoader(MRL mrl)
ModelLoader
given the repository, mrl, and version.mrl
- the mrl of the model to loadpublic java.lang.String getArtifactId()
ModelLoader
.getArtifactId
in interface ModelLoader
ModelLoader
public Application getApplication()
ModelLoader
.getApplication
in interface ModelLoader
ModelLoader
public <I,O> ZooModel<I,O> loadModel(Criteria<I,O> criteria) throws java.io.IOException, ModelNotFoundException, MalformedModelException
loadModel
in interface ModelLoader
I
- the input data typeO
- the output data typecriteria
- the criteria to match against the loaded modeljava.io.IOException
- for various exceptions loading data from the repositoryModelNotFoundException
- if no model with the specified criteria is foundMalformedModelException
- if the model data is malformedpublic java.util.List<Artifact> listModels() throws java.io.IOException
listModels
in interface ModelLoader
java.io.IOException
- for errors reading the artifact listprotected Model createModel(java.nio.file.Path modelPath, java.lang.String name, Device device, Block block, java.util.Map<java.lang.String,java.lang.Object> arguments, java.lang.String engine) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
protected TranslatorFactory getTranslatorFactory(Criteria<?,?> criteria, java.util.Map<java.lang.String,java.lang.Object> arguments)