object Reflect
- Source
- Reflect.scala
- Alphabetic
- By Inheritance
- Reflect
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- class SubClassOf[T] extends AnyRef
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def bindingsFromConfiguration[ScalaTrait, JavaInterface, JavaAdapter <: ScalaTrait, JavaDelegate <: JavaInterface, Default <: ScalaTrait](environment: api.Environment, config: Configuration, key: String, defaultClassName: String)(implicit scalaTrait: SubClassOf[ScalaTrait], javaInterface: SubClassOf[JavaInterface], javaAdapter: ClassTag[JavaAdapter], javaDelegate: ClassTag[JavaDelegate], default: ClassTag[Default]): Seq[Binding[_]]
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 namedefaultClassName
, use that - Otherwise, use the classDefault
If a class has been located, convert that to a binding, by the following rules:
- If it's a subclass of
ScalaTrait
bind it directly - Otherwise, if it's a subclass ofJavaInterface
, bind that toJavaInterface
, and then also return a binding ofJavaAdapter
toScalaTrait
- Otherwise, fail- ScalaTrait
The trait to bind
- JavaInterface
The Java interface for Java versions of the implementation
- JavaAdapter
An adapter class that depends on
JavaInterface
and providesScalaTrait
- JavaDelegate
An implementation of
JavaInterface
that delegates toScalaTrait
, for when the configured class is not an instance ofJavaInterface
.- Default
The default implementation of
ScalaTrait
if no user implementation has been provided- environment
The environment to load classes from
- config
The configuration
- key
The key to look up the classname from the configuration
- returns
Zero or more bindings to provide
ScalaTrait
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def configuredClass[ScalaTrait, JavaInterface, Default <: ScalaTrait](environment: api.Environment, config: Configuration, key: String, defaultClassName: String)(implicit scalaTrait: SubClassOf[ScalaTrait], javaInterface: SubClassOf[JavaInterface], default: ClassTag[Default]): Option[Either[Class[_ <: ScalaTrait], Class[_ <: JavaInterface]]]
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 namedefaultClassName
, use that - Otherwise, use the classDefault
If a class has been located, then return Some, according to the following rules:
- If it's a subclass of
ScalaTrait
return that as Left - Otherwise, if it's a subclass ofJavaInterface
, return that as Right - Otherwise, fail- ScalaTrait
The Scala trait to return
- JavaInterface
The Java interface for Java versions of the implementation
- Default
The default implementation of
ScalaTrait
if no user implementation has been provided- environment
The environment to load classes from
- config
The configuration
- key
The key to look up the classname from the configuration
- def createInstance[T](clazz: Class[_])(implicit arg0: ClassTag[T]): T
- def createInstance[T](fqcn: String, classLoader: ClassLoader)(implicit arg0: ClassTag[T]): T
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def getClass[T](fqcn: String, classLoader: ClassLoader)(implicit arg0: ClassTag[T]): Class[_ <: T]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def simpleName(clazz: Class[_]): String
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- object SubClassOf
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)