Giter VIP home page Giter VIP logo

kotlinx.reflect.lite's Introduction

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>http://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.

kotlinx.reflect.lite's People

Contributors

udalov avatar orangy avatar cy6ergn0m avatar apatrida avatar amaranth avatar

Watchers

James Cloos avatar dev.with avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.