本文整理汇总了C++中JEnv::CallStaticByteMethodA方法的典型用法代码示例。如果您正苦于以下问题:C++ JEnv::CallStaticByteMethodA方法的具体用法?C++ JEnv::CallStaticByteMethodA怎么用?C++ JEnv::CallStaticByteMethodA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JEnv
的用法示例。
在下文中一共展示了JEnv::CallStaticByteMethodA方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CallJavaMethod
//.........这里部分代码省略.........
else if (isSuper)
{
env.CallNonvirtualVoidMethodA(callerJavaObject, clazz, mid, javaArgs);
}
else
{
env.CallVoidMethodA(callerJavaObject, mid, javaArgs);
}
break;
}
case MethodReturnType::Boolean:
{
jboolean result;
if (isStatic)
{
result = env.CallStaticBooleanMethodA(clazz, mid, javaArgs);
}
else if (isSuper)
{
result = env.CallNonvirtualBooleanMethodA(callerJavaObject, clazz, mid, javaArgs);
}
else
{
result = env.CallBooleanMethodA(callerJavaObject, mid, javaArgs);
}
args.GetReturnValue().Set(result != 0 ? True(isolate) : False(isolate));
break;
}
case MethodReturnType::Byte:
{
jbyte result;
if (isStatic)
{
result = env.CallStaticByteMethodA(clazz, mid, javaArgs);
}
else if (isSuper)
{
result = env.CallNonvirtualByteMethodA(callerJavaObject, clazz, mid, javaArgs);
}
else
{
result = env.CallByteMethodA(callerJavaObject, mid, javaArgs);
}
args.GetReturnValue().Set(result);
break;
}
case MethodReturnType::Char:
{
jchar result;
if (isStatic)
{
result = env.CallStaticCharMethodA(clazz, mid, javaArgs);
}
else if (isSuper)
{
result = env.CallNonvirtualCharMethodA(callerJavaObject, clazz, mid, javaArgs);
}
else
{
result = env.CallCharMethodA(callerJavaObject, mid, javaArgs);
}
JniLocalRef str(env.NewString(&result, 1));
jboolean bol = true;
const char* resP = env.GetStringUTFChars(str, &bol);
args.GetReturnValue().Set(ConvertToV8String(resP, 1));
示例2: CallJavaMethod
//.........这里部分代码省略.........
else if (isSuper)
{
env.CallNonvirtualVoidMethodA(callerJavaObject, clazz, mid, javaArgs);
}
else
{
env.CallVoidMethodA(callerJavaObject, mid, javaArgs);
}
break;
}
case 'Z': //bool
{
jboolean result;
if (isStatic)
{
result = env.CallStaticBooleanMethodA(clazz, mid, javaArgs);
}
else if (isSuper)
{
result = env.CallNonvirtualBooleanMethodA(callerJavaObject, clazz, mid, javaArgs);
}
else
{
result = env.CallBooleanMethodA(callerJavaObject, mid, javaArgs);
}
args.GetReturnValue().Set(result != 0 ? True(isolate) : False(isolate));
break;
}
case 'B': //byte
{
jbyte result;
if (isStatic)
{
result = env.CallStaticByteMethodA(clazz, mid, javaArgs);
}
else if (isSuper)
{
result = env.CallNonvirtualByteMethodA(callerJavaObject, clazz, mid, javaArgs);
}
else
{
result = env.CallByteMethodA(callerJavaObject, mid, javaArgs);
}
args.GetReturnValue().Set(result);
break;
}
case 'C': //char
{
jchar result;
if (isStatic)
{
result = env.CallStaticCharMethodA(clazz, mid, javaArgs);
}
else if (isSuper)
{
result = env.CallNonvirtualCharMethodA(callerJavaObject, clazz, mid, javaArgs);
}
else
{
result = env.CallCharMethodA(callerJavaObject, mid, javaArgs);
}
JniLocalRef str(env.NewString(&result, 1));
jboolean bol = true;
const char* resP = env.GetStringUTFChars(str, &bol);
args.GetReturnValue().Set(ConvertToV8String(resP, 1));