1 // Copyright 2012 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.jni_zero; 6 7 import java.lang.annotation.ElementType; 8 import java.lang.annotation.Retention; 9 import java.lang.annotation.RetentionPolicy; 10 import java.lang.annotation.Target; 11 12 /** 13 * Used by the JNI generator to create the necessary JNI bindings and expose this method to native 14 * code. 15 * 16 * <p>Any uncaught Java exceptions will crash the current process. This is generally the desired 17 * behavior, since most exceptions indicate an unexpected error. If your java method expects an 18 * exception, we recommend refactoring to catch exceptions and indicate errors with special return 19 * values instead. If this is not possible, see {@link CalledByNativeUnchecked} instead. 20 */ 21 @Target({ElementType.CONSTRUCTOR, ElementType.METHOD}) 22 @Retention(RetentionPolicy.CLASS) 23 public @interface CalledByNative { 24 /* 25 * If present, tells which inner class the method belongs to. 26 */ value()27 public String value() default ""; 28 } 29