public class LenskitConfigDSL extends BindingDSL
Methods for the LensKit configuration DSL. This extends BindingDSL
with additional methods available at the top level for configuring the LensKit configuration itself.
Modifier | Constructor and Description |
---|---|
|
LenskitConfigDSL(ConfigurationLoader loader)
Construct a new delegate with an empty configuration.
|
protected |
LenskitConfigDSL(ConfigurationLoader loader,
LenskitConfiguration cfg,
URI base)
Construct a new delegate.
|
|
LenskitConfigDSL(ConfigurationLoader loader,
URI base)
Construct a new delegate with an empty configuration.
|
Modifier and Type | Method and Description |
---|---|
URI |
getBaseURI()
Get the base URL for this configuration.
|
LenskitConfiguration |
getConfig()
Get the LensKit configuration being configured.
|
ConfigurationLoader |
getConfigLoader()
Get the configuration loader associated with this DSL (used to power the
#include(java.io.File) method). |
void |
include(URI uri)
Include another configuration file.
|
void |
root(Class<?> type)
Add a root type.
|
void |
setBaseURI(URI base)
Set the base URI for this configuration.
|
addComponent, at, at, at, at, at, at, bind, bind, bindAny, domain, getContext, include, include, include, matching, matching, prefDomain, set, within, within, within, within, within, within
addComponent, in, in, in, wrapContext
public LenskitConfigDSL(ConfigurationLoader loader)
Construct a new delegate with an empty configuration.
loader
- The configuration loader.public LenskitConfigDSL(ConfigurationLoader loader, URI base)
Construct a new delegate with an empty configuration.
loader
- The configuration loaderbase
- The base URLprotected LenskitConfigDSL(ConfigurationLoader loader, LenskitConfiguration cfg, URI base)
Construct a new delegate.
loader
- The configuration loader.cfg
- The context to configure.base
- The base URL.public LenskitConfiguration getConfig()
Get the LensKit configuration being configured.
public ConfigurationLoader getConfigLoader()
Get the configuration loader associated with this DSL (used to power the #include(java.io.File)
method).
IllegalStateException
- if there is no associated loader.@Nonnull public URI getBaseURI()
Get the base URL for this configuration.
public void setBaseURI(URI base)
Set the base URI for this configuration.
base
- The base URI.public void root(Class<?> type)
Add a root type.
type
- The type to add.LenskitConfiguration.addRoot(Class)
public void include(URI uri) throws IOException, RecommenderConfigurationException
BindingDSL
Include another configuration file.
include
in class BindingDSL
uri
- The URI of the configuration file.IOException
- if an error is thrown loading the script.RecommenderConfigurationException
- if there is an error running the script.