Reflection

object Reflection

Types

InstanceMethodDispatcher
Link copied to clipboard
class InstanceMethodDispatcher(instance: Any, methodName: String, matchNumbersLeniently: Boolean, matchClassesQualnames: Boolean, resolveAmbiguousSpecificity: Boolean) : FunctionDispatcher

Dynamic multiple dispatch for Any Kotlin instances by methodName.

PathElement
Link copied to clipboard
data class PathElement(type: Reflection.PathElementType, name: String, doEval: Boolean, params: List<Any?>)
PathElementType
Link copied to clipboard
enum PathElementType : Enum<Reflection.PathElementType>

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
evalKotlinString
Link copied to clipboard
fun evalKotlinString(scope: Any?, string: String): Any?
hashCode
Link copied to clipboard
open fun hashCode(): Int
makeInstanceMethodDispatcher
Link copied to clipboard
fun makeInstanceMethodDispatcher(instance: Any, methodName: String): Reflection.InstanceMethodDispatcher
parseKotlinPath
Link copied to clipboard
fun parseKotlinPath(code: String): List<Reflection.PathElement>
readClassProperty
Link copied to clipboard
fun <R> readClassProperty(cls: KClass<*>, propertyName: String): R?
readInstanceItem
Link copied to clipboard
fun <R> readInstanceItem(instance: Any, keyOrIndex: Any): R
readInstanceProperty
Link copied to clipboard
fun <R> readInstanceProperty(instance: Any, propertyName: String): R?
removeInstanceItem
Link copied to clipboard
fun removeInstanceItem(instance: Any, keyOrIndex: Any)
removeInstancePath
Link copied to clipboard
fun removeInstancePath(instance: Any?, path: List<Reflection.PathElement>)
resolveInstancePath
Link copied to clipboard
fun resolveInstancePath(instance: Any?, path: List<Reflection.PathElement>): Any?
setInstanceItem
Link copied to clipboard
fun setInstanceItem(instance: Any, keyOrIndex: Any, value: Any?)
setInstancePath
Link copied to clipboard
fun setInstancePath(instance: Any?, path: List<Reflection.PathElement>, value: Any?)
setInstanceProperty
Link copied to clipboard
fun <T> setInstanceProperty(instance: Any, propertyName: String, value: T?)
splitToplevelExprs
Link copied to clipboard
fun splitToplevelExprs(code: String): List<String>
fun splitToplevelExprs(code: String, delimiters: CharSequence = ",", bracketPairs: Map<Char, Char> = mapOf('(' to ')', '[' to ']'), maxParts: Int = 0, backSlashEscape: Boolean = false): List<String>
stringifyKotlinPath
Link copied to clipboard
fun stringifyKotlinPath(path: List<Reflection.PathElement>): String
toString
Link copied to clipboard
open fun toString(): String

Properties

bracketmeanings
Link copied to clipboard
private val bracketmeanings: Map<String, Reflection.PathElementType>
brackettypes
Link copied to clipboard
private val brackettypes: Map<Char, String>

Sources

jvm source
Link copied to clipboard