Example #1
0
 Primitive(
     const char* javaClassSpec,
     const char* staticBoxMethod,
     const char* staticBoxMethodSignature,
     const char* unboxMethod,
     const char* unboxMethodSignature) :
     clazz(jniFindClass(javaClassSpec)),
     method_box(jniGetStaticMethodID(clazz.get(), staticBoxMethod, staticBoxMethodSignature)),
     method_unbox(jniGetMethodID(clazz.get(), unboxMethod, unboxMethodSignature)) {}
Example #2
0
JniEnum::JniEnum(const std::string & name)
    : m_clazz { jniFindClass(name.c_str()) },
      m_staticmethValues { jniGetStaticMethodID(m_clazz.get(), "values", ("()[L" + name + ";").c_str()) },
      m_methOrdinal { jniGetMethodID(m_clazz.get(), "ordinal", "()I") }
    {}