Package kotlin.jvm.internal
Class CallableReference
- java.lang.Object
-
- kotlin.jvm.internal.CallableReference
-
- All Implemented Interfaces:
java.io.Serializable
,kotlin.reflect.KAnnotatedElement
,kotlin.reflect.KCallable
- Direct Known Subclasses:
FunctionReference
,PropertyReference
public abstract class CallableReference extends java.lang.Object implements kotlin.reflect.KCallable, java.io.Serializable
A superclass for all classes generated by Kotlin compiler for callable references. All methods from KCallable should be implemented here and should delegate to the actual implementation, loaded dynamically and stored in thereflected
field.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Object
NO_RECEIVER
protected java.lang.Object
receiver
-
Constructor Summary
Constructors Modifier Constructor Description CallableReference()
protected
CallableReference(java.lang.Object receiver)
protected
CallableReference(java.lang.Object receiver, java.lang.Class owner, java.lang.String name, java.lang.String signature, boolean isTopLevel)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
call(java.lang.Object... args)
java.lang.Object
callBy(java.util.Map args)
kotlin.reflect.KCallable
compute()
protected abstract kotlin.reflect.KCallable
computeReflected()
java.util.List<java.lang.annotation.Annotation>
getAnnotations()
java.lang.Object
getBoundReceiver()
java.lang.String
getName()
kotlin.reflect.KDeclarationContainer
getOwner()
java.util.List<kotlin.reflect.KParameter>
getParameters()
protected kotlin.reflect.KCallable
getReflected()
kotlin.reflect.KType
getReturnType()
java.lang.String
getSignature()
java.util.List<kotlin.reflect.KTypeParameter>
getTypeParameters()
kotlin.reflect.KVisibility
getVisibility()
boolean
isAbstract()
boolean
isFinal()
boolean
isOpen()
boolean
isSuspend()
-
-
-
Constructor Detail
-
CallableReference
public CallableReference()
-
CallableReference
@SinceKotlin(version="1.1") protected CallableReference(java.lang.Object receiver)
-
CallableReference
@SinceKotlin(version="1.4") protected CallableReference(java.lang.Object receiver, java.lang.Class owner, java.lang.String name, java.lang.String signature, boolean isTopLevel)
-
-
Method Detail
-
computeReflected
protected abstract kotlin.reflect.KCallable computeReflected()
-
getBoundReceiver
@SinceKotlin(version="1.1") public java.lang.Object getBoundReceiver()
-
compute
@SinceKotlin(version="1.1") public kotlin.reflect.KCallable compute()
-
getReflected
@SinceKotlin(version="1.1") protected kotlin.reflect.KCallable getReflected()
-
getOwner
public kotlin.reflect.KDeclarationContainer getOwner()
- Returns:
- the class or package where the callable should be located, usually specified on the LHS of the '::' operator
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfacekotlin.reflect.KCallable
- Returns:
- Kotlin name of the callable, the one which was declared in the source code (@JvmName doesn't change it)
-
getSignature
public java.lang.String getSignature()
- Returns:
- JVM signature of the callable, e.g. "println(Ljava/lang/Object;)V". If this is a property reference, returns the JVM signature of its getter, e.g. "getFoo(Ljava/lang/String;)I". If the property has no getter in the bytecode (e.g. private property in a class), it's still the signature of the imaginary default getter that would be generated otherwise. Note that technically the signature itself is not even used as a signature per se in reflection implementation, but only as a unique and unambiguous way to map a function/property descriptor to a string.
-
getParameters
public java.util.List<kotlin.reflect.KParameter> getParameters()
- Specified by:
getParameters
in interfacekotlin.reflect.KCallable
-
getReturnType
public kotlin.reflect.KType getReturnType()
- Specified by:
getReturnType
in interfacekotlin.reflect.KCallable
-
getAnnotations
public java.util.List<java.lang.annotation.Annotation> getAnnotations()
- Specified by:
getAnnotations
in interfacekotlin.reflect.KAnnotatedElement
-
getTypeParameters
@SinceKotlin(version="1.1") public java.util.List<kotlin.reflect.KTypeParameter> getTypeParameters()
- Specified by:
getTypeParameters
in interfacekotlin.reflect.KCallable
-
call
public java.lang.Object call(java.lang.Object... args)
- Specified by:
call
in interfacekotlin.reflect.KCallable
-
callBy
public java.lang.Object callBy(java.util.Map args)
- Specified by:
callBy
in interfacekotlin.reflect.KCallable
-
getVisibility
@SinceKotlin(version="1.1") public kotlin.reflect.KVisibility getVisibility()
- Specified by:
getVisibility
in interfacekotlin.reflect.KCallable
-
isFinal
@SinceKotlin(version="1.1") public boolean isFinal()
- Specified by:
isFinal
in interfacekotlin.reflect.KCallable
-
isOpen
@SinceKotlin(version="1.1") public boolean isOpen()
- Specified by:
isOpen
in interfacekotlin.reflect.KCallable
-
isAbstract
@SinceKotlin(version="1.1") public boolean isAbstract()
- Specified by:
isAbstract
in interfacekotlin.reflect.KCallable
-
isSuspend
@SinceKotlin(version="1.3") public boolean isSuspend()
- Specified by:
isSuspend
in interfacekotlin.reflect.KCallable
-
-