MCPcopy Create free account
hub / github.com/NativeScript/android / GetTypeMetadata

Method GetTypeMetadata

test-app/runtime/src/main/cpp/CallbackHandlers.cpp:867–892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

865}
866
867vector<string> CallbackHandlers::GetTypeMetadata(const string &name, int index) {
868 JEnv env;
869
870 string canonicalName = Util::ConvertFromJniToCanonicalName(name);
871
872 JniLocalRef className(env.NewStringUTF(canonicalName.c_str()));
873 jint idx = index;
874
875 JniLocalRef pubApi(
876 env.CallStaticObjectMethod(RUNTIME_CLASS, GET_TYPE_METADATA, (jstring) className, idx));
877
878 jsize length = env.GetArrayLength(pubApi);
879
880 assert(length > 0);
881
882 vector<string> result;
883
884 for (jsize i = 0; i < length; i++) {
885 JniLocalRef s(env.GetObjectArrayElement(pubApi, i));
886 const char *pc = env.GetStringUTFChars(s, nullptr);
887 result.push_back(string(pc));
888 env.ReleaseStringUTFChars(s, pc);
889 }
890
891 return result;
892}
893
894Local<Value> CallbackHandlers::CallJSMethod(Isolate *isolate, JNIEnv *_env,
895 const Local<Object> &jsObject, const string &methodName,

Callers

nothing calls this directly

Calls 6

NewStringUTFMethod · 0.80
GetObjectArrayElementMethod · 0.80
GetStringUTFCharsMethod · 0.80
ReleaseStringUTFCharsMethod · 0.80
GetArrayLengthMethod · 0.45

Tested by

no test coverage detected