kotlin.jvm.internal
Class CallableReference
java.lang.Object
kotlin.jvm.internal.CallableReference
- All Implemented Interfaces:
- kotlin.reflect.KAnnotatedElement, kotlin.reflect.KCallable
- Direct Known Subclasses:
- FunctionReference, PropertyReference
public abstract class CallableReference
- extends Object
- implements kotlin.reflect.KCallable
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 the reflected
field.
Nested classes/interfaces inherited from interface kotlin.reflect.KCallable |
kotlin.reflect.KCallable.DefaultImpls |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
receiver
protected final Object receiver
NO_RECEIVER
public static final Object NO_RECEIVER
CallableReference
public CallableReference()
CallableReference
@SinceKotlin(version="1.1")
protected CallableReference(Object receiver)
computeReflected
protected abstract kotlin.reflect.KCallable computeReflected()
getBoundReceiver
@SinceKotlin(version="1.1")
public 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 String getName()
- Specified by:
getName
in interface kotlin.reflect.KCallable
- Returns:
- Kotlin name of the callable, the one which was declared in the source code (@JvmName doesn't change it)
getSignature
public 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 List<kotlin.reflect.KParameter> getParameters()
- Specified by:
getParameters
in interface kotlin.reflect.KCallable
getReturnType
public kotlin.reflect.KType getReturnType()
- Specified by:
getReturnType
in interface kotlin.reflect.KCallable
getAnnotations
public List<Annotation> getAnnotations()
- Specified by:
getAnnotations
in interface kotlin.reflect.KAnnotatedElement
getTypeParameters
@NotNull
@SinceKotlin(version="1.1")
public List<kotlin.reflect.KTypeParameter> getTypeParameters()
- Specified by:
getTypeParameters
in interface kotlin.reflect.KCallable
call
public Object call(@NotNull
Object... args)
- Specified by:
call
in interface kotlin.reflect.KCallable
callBy
public Object callBy(@NotNull
Map args)
- Specified by:
callBy
in interface kotlin.reflect.KCallable
getVisibility
@Nullable
@SinceKotlin(version="1.1")
public kotlin.reflect.KVisibility getVisibility()
- Specified by:
getVisibility
in interface kotlin.reflect.KCallable
isFinal
@SinceKotlin(version="1.1")
public boolean isFinal()
- Specified by:
isFinal
in interface kotlin.reflect.KCallable
isOpen
@SinceKotlin(version="1.1")
public boolean isOpen()
- Specified by:
isOpen
in interface kotlin.reflect.KCallable
isAbstract
@SinceKotlin(version="1.1")
public boolean isAbstract()
- Specified by:
isAbstract
in interface kotlin.reflect.KCallable
Copyright © 2017. All Rights Reserved.