public class JavaConfigurationBuilderImpl extends ConfigurationBuilderImpl implements JavaConfigurationBuilder
IMPORT, INIT
Constructor and Description |
---|
JavaConfigurationBuilderImpl(Configuration[] confs) |
JavaConfigurationBuilderImpl(URL[] jars) |
JavaConfigurationBuilderImpl(URL[] jars,
Configuration[] confs,
Class<? extends ExternalConstructor<?>>[] parsers) |
Modifier and Type | Method and Description |
---|---|
<T> JavaConfigurationBuilder |
bind(Class<T> c,
Class<?> val)
Bind named parameters, implementations or external constructors, depending
on the types of the classes passed in.
|
<T> JavaConfigurationBuilder |
bindConstructor(Class<T> c,
Class<? extends ExternalConstructor<? extends T>> v) |
<T> JavaConfigurationBuilder |
bindImplementation(Class<T> c,
Class<? extends T> d)
Binds the Class impl as the implementation of the interface iface.
|
<T> JavaConfigurationBuilder |
bindList(Class<? extends Name<List<T>>> iface,
List implList)
Binding list method for JavaConfigurationBuilder.
|
JavaConfigurationBuilder |
bindNamedParameter(Class<? extends Name<?>> name,
String value)
Set the value of a named parameter.
|
<T> JavaConfigurationBuilder |
bindNamedParameter(Class<? extends Name<T>> iface,
Class<? extends T> impl) |
<T> JavaConfigurationBuilder |
bindSetEntry(Class<? extends Name<Set<T>>> iface,
Class<? extends T> impl) |
<T> JavaConfigurationBuilder |
bindSetEntry(Class<? extends Name<Set<T>>> iface,
String value) |
ConfigurationImpl |
build()
Produce an immutable Configuration object that contains the current
bindings and ClassHierarchy of this ConfigurationBuilder.
|
addConfiguration, bind, bind, bindConstructor, bindImplementation, bindList, bindList, bindParameter, bindSetEntry, bindSetEntry, bindSetEntry, bindSetEntry, classPrettyDefaultString, classPrettyDescriptionString, equals, getClassHierarchy, hashCode, registerLegacyConstructor, registerLegacyConstructor, registerLegacyConstructor
getClass, notify, notifyAll, toString, wait, wait, wait
addConfiguration, bind, bind, bindConstructor, bindList, bindList, bindSetEntry, bindSetEntry, bindSetEntry, bindSetEntry, classPrettyDefaultString, classPrettyDescriptionString, getClassHierarchy, registerLegacyConstructor, registerLegacyConstructor, registerLegacyConstructor
public JavaConfigurationBuilderImpl(URL[] jars, Configuration[] confs, Class<? extends ExternalConstructor<?>>[] parsers) throws BindException
BindException
public JavaConfigurationBuilderImpl(URL[] jars) throws BindException
BindException
public JavaConfigurationBuilderImpl(Configuration[] confs) throws BindException
BindException
public ConfigurationImpl build()
ConfigurationBuilder
Since Tang eagerly checks for configuration errors, this method does not perform any additional validation, and does not throw any checkable exceptions.
build
in interface ConfigurationBuilder
build
in class ConfigurationBuilderImpl
public <T> JavaConfigurationBuilder bind(Class<T> c, Class<?> val) throws BindException
JavaConfigurationBuilder
bind
in interface JavaConfigurationBuilder
T
- a typec
- an interface classval
- an implementation classBindException
public <T> JavaConfigurationBuilder bindImplementation(Class<T> c, Class<? extends T> d) throws BindException
JavaConfigurationBuilder
bindImplementation
in interface JavaConfigurationBuilder
T
- a typec
- an interface classd
- an implementation classBindException
public JavaConfigurationBuilder bindNamedParameter(Class<? extends Name<?>> name, String value) throws BindException
JavaConfigurationBuilder
bindNamedParameter
in interface JavaConfigurationBuilder
name
- The dummy class that serves as the name of this parameter.value
- A string representing the value of the parameter. Reef must know
how to parse the parameter's type.NameResolutionException
- which occurs when name resolution failsBindException
public <T> JavaConfigurationBuilder bindNamedParameter(Class<? extends Name<T>> iface, Class<? extends T> impl) throws BindException
bindNamedParameter
in interface JavaConfigurationBuilder
BindException
public <T> JavaConfigurationBuilder bindConstructor(Class<T> c, Class<? extends ExternalConstructor<? extends T>> v) throws BindException
bindConstructor
in interface JavaConfigurationBuilder
BindException
public <T> JavaConfigurationBuilder bindSetEntry(Class<? extends Name<Set<T>>> iface, String value) throws BindException
bindSetEntry
in interface JavaConfigurationBuilder
BindException
public <T> JavaConfigurationBuilder bindSetEntry(Class<? extends Name<Set<T>>> iface, Class<? extends T> impl) throws BindException
bindSetEntry
in interface JavaConfigurationBuilder
BindException
public <T> JavaConfigurationBuilder bindList(Class<? extends Name<List<T>>> iface, List implList) throws BindException
It does not check whether the list's String values can be parsed to T, like bindSetEntry.
bindList
in interface JavaConfigurationBuilder
T
- type of the listiface
- target named parameter to be instantiatedimplList
- implementation list used to instantiate the named parameterBindException
Copyright © 2017 The Apache Software Foundation. All rights reserved.