MCPcopy Index your code
hub / github.com/cedar-policy/cedar-java / template_effect_jni_internal

Function template_effect_jni_internal

CedarJavaFFI/src/interface.rs:880–893  ·  view source on GitHub ↗
(
    env: &mut JNIEnv<'a>,
    policy_jstr: JString<'a>,
)

Source from the content-addressed store, hash-verified

878}
879
880fn template_effect_jni_internal<'a>(
881 env: &mut JNIEnv<'a>,
882 policy_jstr: JString<'a>,
883) -> Result<JValueOwned<'a>> {
884 if policy_jstr.is_null() {
885 raise_npe(env)
886 } else {
887 let policy_jstring = env.get_string(&policy_jstr)?;
888 let policy_string = String::from(policy_jstring);
889 let policy = Template::from_str(&policy_string)?;
890 let policy_effect = policy.effect().to_string();
891 Ok(JValueGen::Object(env.new_string(&policy_effect)?.into()))
892 }
893}
894
895#[jni_fn("com.cedarpolicy.model.policy.Policy")]
896pub fn fromJsonJni<'a>(mut env: JNIEnv<'a>, _: JClass, policy_json_jstr: JString<'a>) -> jvalue {

Calls 3

raise_npeFunction · 0.85
ObjectInterface · 0.85
effectMethod · 0.80