// This file was generated by
// //third_party/jni_zero/jni_zero.py
// For
// org.jni_zero.JavapClass
#ifndef org_jni_1zero_JavapClass_JNI
#define org_jni_1zero_JavapClass_JNI
#include <jni.h>
#include "third_party/jni_zero/jni_export.h"
#include "third_party/jni_zero/jni_zero_helper.h"
// Class Accessors.
#ifndef org_jni_1zero_JavapClass_clazz_defined
#define org_jni_1zero_JavapClass_clazz_defined
inline jclass org_jni_1zero_JavapClass_clazz(JNIEnv* env) {
static const char kClassName[] = "org/jni_zero/JavapClass";
static std::atomic<jclass> cached_class;
return jni_zero::internal::LazyGetClass(env, kClassName, &cached_class);
}
#endif
namespace JNI_JavapClass {
// Constants
enum Java_JavapClass_constant_fields {
CONST_INT = 3,
};
// Native to Java functions
[[maybe_unused]] static jni_zero::ScopedJavaLocalRef<jobject> Java_JavapClass_Constructor(
JNIEnv* env) {
static std::atomic<jmethodID> cached_method_id(nullptr);
jclass clazz = org_jni_1zero_JavapClass_clazz(env);
CHECK_CLAZZ(env, clazz, clazz, nullptr);
jni_zero::internal::JniJavaCallContext<true> call_context;
call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
env,
clazz,
"<init>",
"()V",
&cached_method_id);
auto _ret = env->NewObject(clazz, call_context.method_id());
return jni_zero::ScopedJavaLocalRef<jobject>(env, _ret);
}
[[maybe_unused]] static jni_zero::ScopedJavaLocalRef<jobject> Java_JavapClass_Constructor__boolean(
JNIEnv* env,
jboolean p0) {
static std::atomic<jmethodID> cached_method_id(nullptr);
jclass clazz = org_jni_1zero_JavapClass_clazz(env);
CHECK_CLAZZ(env, clazz, clazz, nullptr);
jni_zero::internal::JniJavaCallContext<true> call_context;
call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
env,
clazz,
"<init>",
"(Z)V",
&cached_method_id);
auto _ret = env->NewObject(clazz, call_context.method_id(), p0);
return jni_zero::ScopedJavaLocalRef<jobject>(env, _ret);
}
[[maybe_unused]] static jni_zero::ScopedJavaLocalRef<jobject> Java_JavapClass_Constructor__int(
JNIEnv* env,
JniIntWrapper p0) {
static std::atomic<jmethodID> cached_method_id(nullptr);
jclass clazz = org_jni_1zero_JavapClass_clazz(env);
CHECK_CLAZZ(env, clazz, clazz, nullptr);
jni_zero::internal::JniJavaCallContext<true> call_context;
call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
env,
clazz,
"<init>",
"(I)V",
&cached_method_id);
auto _ret = env->NewObject(clazz, call_context.method_id(), as_jint(p0));
return jni_zero::ScopedJavaLocalRef<jobject>(env, _ret);
}
[[maybe_unused]] static jint Java_JavapClass_intMethod(
JNIEnv* env,
const jni_zero::JavaRef<jobject>& obj,
const jni_zero::JavaRef<jstring>& p0) {
static std::atomic<jmethodID> cached_method_id(nullptr);
jclass clazz = org_jni_1zero_JavapClass_clazz(env);
CHECK_CLAZZ(env, obj.obj(), clazz, 0);
jni_zero::internal::JniJavaCallContext<true> call_context;
call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
env,
clazz,
"intMethod",
"(Ljava/lang/String;)I",
&cached_method_id);
auto _ret = env->CallIntMethod(
obj.obj(),
call_context.method_id(),
p0.obj());
return _ret;
}
[[maybe_unused]] static void Java_JavapClass_needsMangling__int(
JNIEnv* env,
JniIntWrapper p0) {
static std::atomic<jmethodID> cached_method_id(nullptr);
jclass clazz = org_jni_1zero_JavapClass_clazz(env);
CHECK_CLAZZ(env, clazz, clazz);
jni_zero::internal::JniJavaCallContext<true> call_context;
call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
env,
clazz,
"needsMangling",
"(I)V",
&cached_method_id);
env->CallStaticVoidMethod(clazz, call_context.method_id(), as_jint(p0));
}
[[maybe_unused]] static void Java_JavapClass_needsMangling__String(
JNIEnv* env,
const jni_zero::JavaRef<jstring>& p0) {
static std::atomic<jmethodID> cached_method_id(nullptr);
jclass clazz = org_jni_1zero_JavapClass_clazz(env);
CHECK_CLAZZ(env, clazz, clazz);
jni_zero::internal::JniJavaCallContext<true> call_context;
call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
env,
clazz,
"needsMangling",
"(Ljava/lang/String;)V",
&cached_method_id);
env->CallStaticVoidMethod(clazz, call_context.method_id(), p0.obj());
}
[[maybe_unused]] static void Java_JavapClass_needsMangling__java_util_ArrayList(
JNIEnv* env,
const jni_zero::JavaRef<jobject>& p0) {
static std::atomic<jmethodID> cached_method_id(nullptr);
jclass clazz = org_jni_1zero_JavapClass_clazz(env);
CHECK_CLAZZ(env, clazz, clazz);
jni_zero::internal::JniJavaCallContext<true> call_context;
call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
env,
clazz,
"needsMangling",
"(Ljava/util/ArrayList;)V",
&cached_method_id);
env->CallStaticVoidMethod(clazz, call_context.method_id(), p0.obj());
}
[[maybe_unused]] static jni_zero::ScopedJavaLocalRef<jclass> Java_JavapClass_objTest(
JNIEnv* env,
const jni_zero::JavaRef<jobject>& obj,
const jni_zero::JavaRef<jobject>& p0,
const jni_zero::JavaRef<jobjectArray>& p1) {
static std::atomic<jmethodID> cached_method_id(nullptr);
jclass clazz = org_jni_1zero_JavapClass_clazz(env);
CHECK_CLAZZ(env, obj.obj(), clazz, nullptr);
jni_zero::internal::JniJavaCallContext<true> call_context;
call_context.Init<jni_zero::MethodID::TYPE_INSTANCE>(
env,
clazz,
"objTest",
"(Ljava/lang/Object;[Ljava/lang/Runnable;)Ljava/lang/Class;",
&cached_method_id);
auto _ret = env->CallObjectMethod(
obj.obj(),
call_context.method_id(),
p0.obj(),
p1.obj());
jclass _ret2 = static_cast<jclass>(_ret);
return jni_zero::ScopedJavaLocalRef<jclass>(env, _ret2);
}
[[maybe_unused]] static jint Java_JavapClass_staticIntMethod(
JNIEnv* env,
const jni_zero::JavaRef<jstring>& p0,
const jni_zero::JavaRef<jobject>& p1) {
static std::atomic<jmethodID> cached_method_id(nullptr);
jclass clazz = org_jni_1zero_JavapClass_clazz(env);
CHECK_CLAZZ(env, clazz, clazz, 0);
jni_zero::internal::JniJavaCallContext<true> call_context;
call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
env,
clazz,
"staticIntMethod",
"(Ljava/lang/String;Lorg/jni_zero/JavapClass;)I",
&cached_method_id);
auto _ret = env->CallStaticIntMethod(
clazz,
call_context.method_id(),
p0.obj(),
p1.obj());
return _ret;
}
[[maybe_unused]] static jni_zero::ScopedJavaLocalRef<jobjectArray> Java_JavapClass_staticIntMethod(
JNIEnv* env,
const jni_zero::JavaRef<jstring>& p0) {
static std::atomic<jmethodID> cached_method_id(nullptr);
jclass clazz = org_jni_1zero_JavapClass_clazz(env);
CHECK_CLAZZ(env, clazz, clazz, nullptr);
jni_zero::internal::JniJavaCallContext<true> call_context;
call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
env,
clazz,
"staticIntMethod",
"(Ljava/lang/String;)[[I",
&cached_method_id);
auto _ret = env->CallStaticObjectMethod(
clazz,
call_context.method_id(),
p0.obj());
jobjectArray _ret2 = static_cast<jobjectArray>(_ret);
return jni_zero::ScopedJavaLocalRef<jobjectArray>(env, _ret2);
}
} // namespace JNI_JavapClass
#endif // org_jni_1zero_JavapClass_JNI