GithubHelp home page GithubHelp logo

gonbe's Introduction

gonbe

A terse reflection API for Java

gonbe is a simple wrapper for the java.lang.reflect package.

This project is similar to jOOR, but with the following key differences:

  • ObjectMirror and ClassMirror are represented with separate types, whereas jOOR conflates the two (under a name Reflect).
  • The get, set, and call methods on Mirror have their m-suffixed counterparts which wrap the output in Mirror. e.g. Mirror.on("hello").call("charAt", 0) returns 'h' whereas Mirror.on("hello").callM("charAt", 0) returns Mirror.on('h').
  • The implementation makes extensive use of functionaljava, though that's irrelevant from the user point of view.

Example

// With java.lang.reflect:
PrivateObject privateObject = new PrivateObject("The Private Value");
Class<?>[] paramTypes = { int.class, String.class };
Object[] args = { 3, "Hello" };
Method privateStringMethod = PrivateObject.class.getDeclaredMethod("getPrivateString", paramTypes);
privateStringMethod.setAccessible(true);
String returnValue = (String) privateStringMethod.invoke(privateObject, args);

// With gonbe:
PrivateObject privateObject = new PrivateObject("The Private Value");
String returnValue = Mirror.on(privateObject).call("getPrivateString", 3, "hello");

gonbe's People

Contributors

missingfaktor avatar

Watchers

 avatar  avatar  avatar

gonbe's Issues

Weekly Digest (16 August, 2018 - 23 August, 2018)

Here's the Weekly Digest for missingfaktor/gonbe:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please ๐Ÿ‘€ Watch and โญ Star the repository missingfaktor/gonbe to receive next weekly updates. ๐Ÿ˜ƒ

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. ๐Ÿ“†

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.