-
Notifications
You must be signed in to change notification settings - Fork 6
JniGen Code Generator
Using SimpleJNI in your C++ code solves many problems - type safety, RAII, need to lookup classes and methods by string names etc. However, one problem still remains. For every Java entity that needs to be visible from C++ code: classes, methods, fields or native methods there is some boilerplate code to write. It's only a few lines and it closely parallels the Java code but it is tedious, repetitive and violates DRY principle. If you make a change you need to to make it twice. If you forget you'll get runtime errors. The JniGen code generator solves this issue by generating necessary boilerplate C++ code from Java automatically. It relies on Java or Kotlin annotations and a Java, KAPT or KSP annotation processors. The following pages describe how to set it up and use it.
- Building
-
User's Guide
Declaring Java Types
Accessing Methods and Fields
Representing Java Classes
Implementing Native Methods
Smart References
Error Handling
Obtaining JNIEnv
Initialization
Strings
Arrays
Direct Buffers
Booleans
Sizes -
JniGen Code Generator
Integrating JniGen
Annotations
Processor Options