Menu

Tree [c17e0b] master /
 History

HTTPS access


File Date Author Commit
 include 2011-03-07 Jamie F Olson Jamie F Olson [c17e0b] Initial commit
 src 2011-03-07 Jamie F Olson Jamie F Olson [c17e0b] Initial commit
 LICENSE 2011-03-07 Jamie F Olson Jamie F Olson [c17e0b] Initial commit
 README 2011-03-07 Jamie F Olson Jamie F Olson [c17e0b] Initial commit
 generatePackage.sh 2011-03-07 Jamie F Olson Jamie F Olson [c17e0b] Initial commit
 jannotater.jar 2011-03-07 Jamie F Olson Jamie F Olson [c17e0b] Initial commit

Read Me

This simple library will process the annotations in Java files and create a basic R interface to those constructors and methods.  Annotations are currently only allowed on Constructor and Method declarations.  There is NO checking for name collisions in the R interface, so multiple Java methods or constructors may be exported as R functions of the same name, with only the last one being defined.

For this and other reasons (adding your own documentation), it is recommended that you test, edit and document the generated interface rather than immediately using the generated interface.  Of course, if you only expose a small number of methods and one constructor and your javadoc is good, then you should be okay.



EXAMPLE:  $ indicates shell commands, > indicates R commands

$ ./generatePackage.sh mytest src/ jannotater.jar
$ R CMD INSTALL mytest/
$ R
$ 

> library(mytest)
> Loading required package: rJava
> sayAnything(newHelloJavaWorld("message"))
> Error: could not find function "sayAnything"
> sayHello(newHelloJavaWorld("message"))
> [1] "Hello Java World!"
> sayArray(newHelloJavaWorld("message"))
> [1] 1 2 3
 
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.