public class ConfigHelpers
extends java.lang.Object
LensKit configuration helper utilities.
Modifier and Type | Method and Description |
---|---|
static void |
configure(LenskitConfiguration config,
groovy.lang.Closure<?> block)
Modify a configuration from a closure.
|
static LenskitConfiguration |
load(groovy.lang.Closure<?> block)
Load a LensKit configuration from a Groovy closure.
|
static LenskitConfiguration |
load(java.io.File script)
Load a LensKit configuration from a script file.
|
static LenskitConfiguration |
load(java.lang.String script)
Deprecated.
Loading from Groovy source strings is confusing.
|
static LenskitConfiguration |
load(java.net.URL script)
Load a LensKit configuration from a script URL.
|
public static LenskitConfiguration load(@DelegatesTo(value=LenskitConfigDSL.class) groovy.lang.Closure<?> block) throws RecommenderConfigurationException
Load a LensKit configuration from a Groovy closure. This is useful for using the Groovy DSL in unit tests.
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
ConfigurationLoader.load(groovy.lang.Closure)
@Deprecated public static LenskitConfiguration load(java.lang.String script) throws RecommenderConfigurationException
Load a LensKit configuration from a script (as a string).
script
- The script source text to evaluate.RecommenderConfigurationException
public static LenskitConfiguration load(java.io.File script) throws java.io.IOException, RecommenderConfigurationException
Load a LensKit configuration from a script file.
script
- The script source file to evaluate.java.io.IOException
RecommenderConfigurationException
public static LenskitConfiguration load(java.net.URL script) throws java.io.IOException, RecommenderConfigurationException
Load a LensKit configuration from a script URL.
script
- The script source URL to evaluate.java.io.IOException
RecommenderConfigurationException
public static void configure(LenskitConfiguration config, @Nonnull @DelegatesTo(value=LenskitConfigDSL.class) groovy.lang.Closure<?> block) throws RecommenderConfigurationException
Modify 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