• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Kotlin/kotlinx.reflect.lite: Lightweight library allowing to introspect basic st ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Kotlin/kotlinx.reflect.lite

开源软件地址(OpenSource Url):

https://github.com/Kotlin/kotlinx.reflect.lite

开源编程语言(OpenSource Language):

Kotlin 72.9%

开源软件介绍(OpenSource Introduction):

Kotlin Experimental JetBrains incubator project Kotlin Kotlin Slack

kotlinx.reflect.lite

This library provides an API to introspect Kotlin symbols at runtime. Its main feature is the small size which makes it possible to use it on memory-constrained devices.

Download

Maven

Add jcenter repository (if you don't have it yet)

<repository>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
    <id>central</id>
    <name>bintray</name>
    <url>https://jcenter.bintray.com</url>
</repository>

Add a dependency:

<dependency>
    <groupId>org.jetbrains.kotlinx</groupId>
    <artifactId>kotlinx.reflect.lite</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle

jcenter is configured by default in gradle however you may need to include it in some cases

repositories {
    jcenter()
}

Add a dependency:

compile 'org.jetbrains.kotlinx:kotlinx.reflect.lite:1.0.0'

FAQ

Why not just use Java reflection instead?

Java reflection cannot figure out Kotlin-specific features of the introspected program. For example, nullability of Kotlin types is erased in JVM bytecode.

Also parameter names were not supported in Java reflection until Java 8.

Why not just use Kotlin reflection instead?

While Kotlin has its own reflection library, its size is currently above 2Mb which may be unacceptable in some circumstances, for example on Android.

The size of the minimized version of this library is about 100Kb plus the dependency on protobuf-java.

What is supported?

Currently the only supported features are names of parameters and nullability of their types.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap