summaryrefslogtreecommitdiff
path: root/base/android/java/src/org/chromium/base/JNIAdditionalImport.java
blob: 499d158ad8e4d4348caa8da7f4ea38a83e1c1eae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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();
}