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,
java.net.URI base)
Construct a new delegate.
|
|
LenskitConfigDSL(ConfigurationLoader loader,
java.net.URI base)
Construct a new delegate with an empty configuration.
|
Modifier and Type | Method and Description |
---|---|
java.net.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(java.net.URI uri)
Include another configuration file.
|
void |
root(java.lang.Class<?> type)
Add a root type.
|
void |
setBaseURI(java.net.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, java.net.URI base)
Construct a new delegate with an empty configuration.
loader
- The configuration loaderbase
- The base URLprotected LenskitConfigDSL(ConfigurationLoader loader, LenskitConfiguration cfg, java.net.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).
java.lang.IllegalStateException
- if there is no associated loader.@Nonnull public java.net.URI getBaseURI()
Get the base URL for this configuration.
public void setBaseURI(java.net.URI base)
Set the base URI for this configuration.
base
- The base URI.public void root(java.lang.Class<?> type)
Add a root type.
type
- The type to add.LenskitConfiguration.addRoot(Class)
public void include(java.net.URI uri) throws java.io.IOException, RecommenderConfigurationException
BindingDSL
Include another configuration file.
include
in class BindingDSL
uri
- The URI of the configuration file.java.io.IOException
- if an error is thrown loading the script.RecommenderConfigurationException
- if there is an error running the script.