public class ConfigurationLoader extends Object
Load LensKit configurations using the configuration DSL.
Constructor and Description |
---|
ConfigurationLoader()
Construct a new configuration loader.
|
ConfigurationLoader(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(File file)
Load a configuration from a file.
|
LenskitConfiguration |
load(String source)
Deprecated.
Loading from Groovy sources as strings is confusing.
|
LenskitConfiguration |
load(URL url)
Load a configuration from a URL.
|
LenskitConfigScript |
loadScript(File file)
Load a configuration script from a file.
|
LenskitConfigScript |
loadScript(groovy.lang.GroovyCodeSource source,
URI base)
Load a LensKit configuration script.
|
LenskitConfigScript |
loadScript(String source)
Load a configuration script from a script source.
|
LenskitConfigScript |
loadScript(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(ClassLoader loader)
Construct a new configuration loader.
loader
- The class loader to use.public ClassDirectory getDirectory()
public LenskitConfigScript loadScript(groovy.lang.GroovyCodeSource source, 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 File file) throws IOException, RecommenderConfigurationException
Load a configuration from a file.
file
- The configuration script to load.IOException
RecommenderConfigurationException
public LenskitConfiguration load(@Nonnull URL url) throws IOException, RecommenderConfigurationException
Load a configuration from a URL.
url
- The configuration script to load.IOException
RecommenderConfigurationException
@Deprecated public LenskitConfiguration load(@Nonnull String source) throws RecommenderConfigurationException
Load a configuration from a script source.
source
- The configuration script to load.RecommenderConfigurationException
public LenskitConfigScript loadScript(@Nonnull File file) throws IOException, RecommenderConfigurationException
Load a configuration script from a file.
file
- The configuration script to load.IOException
RecommenderConfigurationException
public LenskitConfigScript loadScript(@Nonnull URL url) throws IOException, RecommenderConfigurationException
Load a configuration script from a URL.
url
- The configuration script to load.IOException
RecommenderConfigurationException
public LenskitConfigScript loadScript(@Nonnull 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