Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2106)

Unified Diff: base/android/java/src/org/chromium/base/JNIAdditionalImport.java

Issue 290403002: Adding JNIAdditionalImport annotation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Follow review Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/android/jni_generator/jni_generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/JNIAdditionalImport.java
diff --git a/base/android/java/src/org/chromium/base/JNIAdditionalImport.java b/base/android/java/src/org/chromium/base/JNIAdditionalImport.java
new file mode 100644
index 0000000000000000000000000000000000000000..36b394523eeb2afd4db67f851eb0e67b34bde899
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/JNIAdditionalImport.java
@@ -0,0 +1,35 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * JNIAdditionalImport is used by the JNI generator to qualify inner types used on JNI methods. Must
+ * be used when an inner class is used from a class within the same package. Example:
+ *
+ * <pre>
+ * @JNIAdditionImport(Foo.class)
+ * public class Bar {
+ * @CalledByNative static void doSomethingWithInner(Foo.Inner inner) {
+ * ...
+ * }
+ * }
+ * <pre>
+ * <p>
+ * Notes:
+ * 1) Foo must be in the same package as Bar
+ * 2) For classes in different packages, they should be imported as:
+ * import other.package.Foo;
+ * and this annotation should not be used.
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.CLASS)
+public @interface JNIAdditionalImport {
+ Class<?> value();
+}
« no previous file with comments | « no previous file | base/android/jni_generator/jni_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698