public class ConfigurationLoader
extends java.lang.Object
Load LensKit configurations using the configuration DSL.
Constructor and Description |
---|
ConfigurationLoader()
Construct a new configuration loader.
|
ConfigurationLoader(java.lang.ClassLoader loader)
Construct a new configuration loader.
|
Modifier and Type | Method and Description |
---|---|
ClassDirectory |
getDirectory() |
LenskitConfiguration |
load(groovy.lang.Closure<?> block)
Deprecated.
Use
ConfigHelpers.load(groovy.lang.Closure) instead. |
LenskitConfiguration |
load(java.io.File file)
Load a configuration from a file.
|
LenskitConfiguration |
load(java.lang.String source)
Deprecated.
Loading from Groovy sources as strings is confusing.
|
LenskitConfiguration |
load(java.net.URL url)
Load a configuration from a URL.
|
LenskitConfigScript |
loadScript(java.io.File file)
Load a configuration script from a file.
|
LenskitConfigScript |
loadScript(groovy.lang.GroovyCodeSource source,
java.net.URI base)
Load a LensKit configuration script.
|
LenskitConfigScript |
loadScript(java.lang.String source)
Load a configuration script from a script source.
|
LenskitConfigScript |
loadScript(java.net.URL url)
Load a configuration script from a URL.
|
public ConfigurationLoader()
Construct a new configuration loader. It uses the current thread’s class loader.
public ConfigurationLoader(java.lang.ClassLoader loader)
Construct a new configuration loader.
loader
- The class loader to use.public ClassDirectory getDirectory()
public LenskitConfigScript loadScript(groovy.lang.GroovyCodeSource source, java.net.URI base) throws RecommenderConfigurationException
Load a LensKit configuration script. This method is for internal use that needs to override how configuration scripts are loaded.
source
- The sourcebase
- The base URI for this configurationRecommenderConfigurationException
public LenskitConfiguration load(@Nonnull java.io.File file) throws java.io.IOException, RecommenderConfigurationException
Load a configuration from a file.
file
- The configuration script to load.java.io.IOException
RecommenderConfigurationException
public LenskitConfiguration load(@Nonnull java.net.URL url) throws java.io.IOException, RecommenderConfigurationException
Load a configuration from a URL.
url
- The configuration script to load.java.io.IOException
RecommenderConfigurationException
@Deprecated public LenskitConfiguration load(@Nonnull java.lang.String source) throws RecommenderConfigurationException
Load a configuration from a script source.
source
- The configuration script to load.RecommenderConfigurationException
public LenskitConfigScript loadScript(@Nonnull java.io.File file) throws java.io.IOException, RecommenderConfigurationException
Load a configuration script from a file.
file
- The configuration script to load.java.io.IOException
RecommenderConfigurationException
public LenskitConfigScript loadScript(@Nonnull java.net.URL url) throws java.io.IOException, RecommenderConfigurationException
Load a configuration script from a URL.
url
- The configuration script to load.java.io.IOException
RecommenderConfigurationException
public LenskitConfigScript loadScript(@Nonnull java.lang.String source) throws RecommenderConfigurationException
Load a configuration script from a script source.
source
- The configuration script to load.RecommenderConfigurationException
@Deprecated public LenskitConfiguration load(@Nonnull groovy.lang.Closure<?> block) throws RecommenderConfigurationException
ConfigHelpers.load(groovy.lang.Closure)
instead.Load a configuration from a closure. The class loader is not really consulted in this case.
block
- The block to evaluate. This block will be evaluated with a delegate providing the LensKit DSL and the Closure.DELEGATE_FIRST
resolution strategy.RecommenderConfigurationException