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 PROXY, 34 CURRENT; 35 nativeValue()36 String nativeValue() { 37 return "mozilla::jni::DispatchTarget::" + name(); 38 } 39 } 40 41 public final String wrapperName; 42 public final ExceptionMode exceptionMode; 43 public final CallingThread callingThread; 44 public final DispatchTarget dispatchTarget; 45 AnnotationInfo(String wrapperName, ExceptionMode exceptionMode, CallingThread callingThread, DispatchTarget dispatchTarget)46 public AnnotationInfo(String wrapperName, ExceptionMode exceptionMode, 47 CallingThread callingThread, DispatchTarget dispatchTarget) { 48 49 this.wrapperName = wrapperName; 50 this.exceptionMode = exceptionMode; 51 this.callingThread = callingThread; 52 this.dispatchTarget = dispatchTarget; 53 } 54 } 55