public class Reflect$
extends java.lang.Object
INTERNAL API
Modifier and Type | Field and Description |
---|---|
static Reflect$ |
MODULE$
Static reference to the singleton instance of this Scala object.
|
Constructor and Description |
---|
Reflect$() |
Modifier and Type | Method and Description |
---|---|
java.lang.ClassLoader |
findClassLoader()
INTERNAL API
|
<T> java.lang.reflect.Constructor<T> |
findConstructor(java.lang.Class<T> clazz,
scala.collection.immutable.Seq<java.lang.Object> args)
INTERNAL API
Implements a primitive form of overload resolution a.k.a.
|
java.lang.reflect.Type |
findMarker(java.lang.Class<?> root,
java.lang.Class<?> marker) |
scala.Option<scala.Function1<java.lang.Object,java.lang.Class<?>>> |
getCallerClass()
This optionally holds a function which looks N levels above itself
on the call stack and returns the
Class[_] object for the code
executing in that stack frame. |
<T> T |
instantiate(java.lang.Class<T> clazz)
INTERNAL API
|
<T> T |
instantiate(java.lang.Class<T> clazz,
scala.collection.immutable.Seq<java.lang.Object> args)
INTERNAL API
Calls findConstructor and invokes it with the given arguments.
|
<T> T |
instantiate(java.lang.reflect.Constructor<T> constructor,
scala.collection.immutable.Seq<java.lang.Object> args)
INTERNAL API
Invokes the constructor with the given arguments.
|
<T> scala.Function0<T> |
instantiator(java.lang.Class<T> clazz)
INTERNAL API
|
protected boolean |
lookupAndSetField(java.lang.Class<?> clazz,
java.lang.Object instance,
java.lang.String name,
java.lang.Object value)
INTERNAL API
Set a val inside a class.
|
public static final Reflect$ MODULE$
public scala.Option<scala.Function1<java.lang.Object,java.lang.Class<?>>> getCallerClass()
Class[_]
object for the code
executing in that stack frame. Implemented using
sun.reflect.Reflection.getCallerClass
if available, None otherwise.
Hint: when comparing to Thread.currentThread.getStackTrace, add two levels.
public <T> T instantiate(java.lang.Class<T> clazz)
clazz
- the class which to instantiate an instance ofpublic <T> T instantiate(java.lang.Class<T> clazz, scala.collection.immutable.Seq<java.lang.Object> args)
clazz
- (undocumented)args
- (undocumented)public <T> T instantiate(java.lang.reflect.Constructor<T> constructor, scala.collection.immutable.Seq<java.lang.Object> args)
constructor
- (undocumented)args
- (undocumented)public <T> java.lang.reflect.Constructor<T> findConstructor(java.lang.Class<T> clazz, scala.collection.immutable.Seq<java.lang.Object> args)
clazz
- (undocumented)args
- (undocumented)public <T> scala.Function0<T> instantiator(java.lang.Class<T> clazz)
clazz
- the class which to instantiate an instance ofpublic java.lang.reflect.Type findMarker(java.lang.Class<?> root, java.lang.Class<?> marker)
protected final boolean lookupAndSetField(java.lang.Class<?> clazz, java.lang.Object instance, java.lang.String name, java.lang.Object value)
clazz
- (undocumented)instance
- (undocumented)name
- (undocumented)value
- (undocumented)public java.lang.ClassLoader findClassLoader()