1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 package org.mozilla.gecko.annotationProcessors;
6 
7 /**
8  * Object holding annotation data. Used by GeneratableElementIterator.
9  */
10 public class AnnotationInfo {
11     public enum ExceptionMode {
12         ABORT,
13         NSRESULT,
14         IGNORE;
15 
nativeValue()16         String nativeValue() {
17             return "mozilla::jni::ExceptionMode::" + name();
18         }
19     }
20 
21     public enum CallingThread {
22         GECKO,
23         UI,
24         ANY;
25 
nativeValue()26         String nativeValue() {
27             return "mozilla::jni::CallingThread::" + name();
28         }
29     }
30 
31     public enum DispatchTarget {
32         GECKO,
33         GECKO_PRIORITY,
34         PROXY,
35         CURRENT;
36 
nativeValue()37         String nativeValue() {
38             return "mozilla::jni::DispatchTarget::" + name();
39         }
40     }
41 
42     public final String wrapperName;
43     public final ExceptionMode exceptionMode;
44     public final CallingThread callingThread;
45     public final DispatchTarget dispatchTarget;
46     public final boolean noLiteral;
47 
AnnotationInfo(String wrapperName, ExceptionMode exceptionMode, CallingThread callingThread, DispatchTarget dispatchTarget, boolean noLiteral)48     public AnnotationInfo(String wrapperName, ExceptionMode exceptionMode,
49                           CallingThread callingThread, DispatchTarget dispatchTarget,
50                           boolean noLiteral) {
51 
52         this.wrapperName = wrapperName;
53         this.exceptionMode = exceptionMode;
54         this.callingThread = callingThread;
55         this.dispatchTarget = dispatchTarget;
56         this.noLiteral = noLiteral;
57     }
58 }
59