Giter Club home page Giter Club logo

jjsbridge's Introduction

JJSBridge

Java-JavaScript bridge, to be nice

Basically, I wanted a way that I could run JS scripts in my program like in any webbrowser. This means:

  • No importClass or importPackage stuff. I want the script sandboxed, so you aren't able to access classes unless the program writer explicitly allows it. Also, no package names.
  • A suite of simple and robustly mirrors of what you can do in a webbrowser. For example, there should be a port of XMLHttpRequest accessible, compliant (as much as possible) to the web standards.
  • Give fields & methods a permission system (like Object.defineProperty). You should be able to have a read-only field, add a getter or setter, or make unaccessible properties.
  • Bridged classes' methods (Java methods called in JS) should be full objects, so I can set custom properties if I want to.
  • A simple way of controlling script execution, maybe multithreaded.

Getting started

  1. Compile your own jar or get a release, and add it to your classpath.
  2. Mark your methods, fields, and classes with annotations (more on that later)
  3. Create a JSBridge, and export some classes/objects into it.
  4. Load in some JS
  5. Run it
  6. There is no step 6!

Annotating stuff

Annotations are used to describe how everything should be accessible to a JS script. Methods and Fields not annotated, by default, are invisible, and unannotated classes may have suboptimal behavior.

jjsbridge's People

Watchers

 avatar  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.