Annotating Java Source

To use this tool you annotate a single Java source class using the ExportToC annotation.
For example:

    
    @ExportToC(prefix="PF_")
    public class TestClass {
        ...
    }

Then within the selected class you annotate public static methods to be "exported" to the C shim code, such as:.

    
    @ExportMethod
    public static void twoArgs(float arg1, String[] arg2){
        ...
    }

    @ExportMethod
    public static double aDoubleValue() throws Exception {
        ...
    }

The first method takes a float argument and a String array as arguments. It has no return value. The second method has no aguments but returns a double value. Also it can throw an exception.

Once the Java class and the selected methods have been annotated you run the tool to generate the shim.

Supported Data Types

Method arguments and return types can be:
  • long
  • int
  • short
  • byte
  • float
  • double
  • char
  • String
Arguments and return types can also be single-dimensioned arrays of these types as well.


Nazario Irizarry, Jr.
n_irizarry (at) users (dot) sourceforge (dot) net
© 2013 The MITRE Corporation. All Rights Reserved.
Approved for Public Release: 13-2602. Distribution Unlimited.