JavaAnnotateR Code
Status: Alpha
Brought to you by:
inspired2apathy
File | Date | Author | Commit |
---|---|---|---|
include | 2011-03-07 |
![]() |
[c17e0b] Initial commit |
src | 2011-03-07 |
![]() |
[c17e0b] Initial commit |
LICENSE | 2011-03-07 |
![]() |
[c17e0b] Initial commit |
README | 2011-03-07 |
![]() |
[c17e0b] Initial commit |
generatePackage.sh | 2011-03-07 |
![]() |
[c17e0b] Initial commit |
jannotater.jar | 2011-03-07 |
![]() |
[c17e0b] Initial commit |
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