Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72764

Java Utilities

$
0
0
For anyone interested in using the Java API, I've set up a new repository with cleaner versions of some of the classes/methods I've built out to use the API. A fair amount of the classes are derived from the code used in the package jsonio (available from SSC), but do not include any of the Jackson JSON Annotations. The javadocs are available at http://wbuchanan.github.io/StataJavaUtilities/. There are JARs with the compiled classes, source, and javadocs available as well. If you wanted/needed to use any of the classes in your own work, once you download the file you can use the following to make the classes available with Maven from the command line:

Code:
// compiled classes/methods (classes / all)
mvn install:install-file -DgroupId=org.paces.Stata -DartifactId=java -Dversion=0.0.1 -Dpackaging=jar -Dfile=StataJavaUtilities.jar 

// javadocs (javadoc / all)
mvn install:install-file -DgroupId=org.paces.Stata -DartifactId=java -Dversion=0.0.1 -Dpackaging=jar -Dfile=StataJavaUtilities-javadoc.jar 

// Source code (src / all)
mvn install:install-file -DgroupId=org.paces.Stata -DartifactId=java -Dversion=0.0.1 -Dpackaging=jar -Dfile=StataJavaUtilities-sources.jar
There is also a simple ado in the repository that you could use to automate this (it should copy the JARs to the Stata CLASSPATH and install it in your local maven repository for you unless you're working on Windows since the command line works a bit differently). :

Code:
// Update/Install all of the JARs above and make them available in maven after downloading (should work for any *nix based system)
javautils, upd(all) mav

// Add just the compiled classes to Stata's CLASSPATH
javautils, upd(classes) 

// Print a hyperlink to the source code repository
javautils, url
The allowed arguments for the update parameter appear in parentheses in the first code block: all, classes, javadoc, or src. I tried to document things fairly thoroughly but if you have questions feel free to ask and hopefully this will make it a bit easier for you/others to use the Java API.

Viewing all articles
Browse latest Browse all 72764

Trending Articles