Reflect
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Reflect.type
Members list
Type members
Classlikes
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SubClassOf.type
Value members
Concrete methods
Lookup the given key from the given configuration, and provide bindings for the ScalaTrait to a class by that key.
Lookup the given key from the given configuration, and provide bindings for the ScalaTrait to a class by that key.
The end goal is to provide a binding for ScalaTrait. The logic for finding the implementation goes like this:
- If the value of the configured key is
provided, this indicates the user will provide their own binding, so return nothing. - If the value of the configured key is a class that exists, then use that
- If the value of the configured key is not a class that exists, fail
- Otherwise if no configuration value is found for key, then if there is a class found with name
defaultClassName, use that - Otherwise, use the class
Default
If a class has been located, convert that to a binding, by the following rules:
- If it's a subclass of
ScalaTraitbind it directly - Otherwise, if it's a subclass of
JavaInterface, bind that toJavaInterface, and then also return a binding ofJavaAdaptertoScalaTrait - Otherwise, fail
Type parameters
- Default
-
The default implementation of
ScalaTraitif no user implementation has been provided - JavaAdapter
-
An adapter class that depends on
JavaInterfaceand providesScalaTrait - JavaDelegate
-
An implementation of
JavaInterfacethat delegates toScalaTrait, for when the configured class is not an instance ofJavaInterface. - JavaInterface
-
The Java interface for Java versions of the implementation
- ScalaTrait
-
The trait to bind
Value parameters
- config
-
The configuration
- environment
-
The environment to load classes from
- key
-
The key to look up the classname from the configuration
Attributes
- Returns
-
Zero or more bindings to provide
ScalaTrait
Lookup the given key from the given configuration, and load it either as an instance of ScalaTrait, or JavaInterface.
Lookup the given key from the given configuration, and load it either as an instance of ScalaTrait, or JavaInterface.
If no user provided class can be found, then return Default.
- If the value of the configured key is
provided, this indicates the user will provide their own binding, so return None. - If the value of the configured key is a class that exists, then use that
- If the value of the configured key is not a class that exists, fail
- Otherwise if no configuration value is found for key, then if there is a class found with name
defaultClassName, use that - Otherwise, use the class
Default
If a class has been located, then return Some, according to the following rules:
- If it's a subclass of
ScalaTraitreturn that as Left - Otherwise, if it's a subclass of
JavaInterface, return that as Right - Otherwise, fail
Type parameters
- Default
-
The default implementation of
ScalaTraitif no user implementation has been provided - JavaInterface
-
The Java interface for Java versions of the implementation
- ScalaTrait
-
The Scala trait to return
Value parameters
- config
-
The configuration
- environment
-
The environment to load classes from
- key
-
The key to look up the classname from the configuration