AnnotationInfo.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. package org.mozilla.gecko.annotationProcessors;
  5. /**
  6. * Object holding annotation data. Used by GeneratableElementIterator.
  7. */
  8. public class AnnotationInfo {
  9. public enum ExceptionMode {
  10. ABORT,
  11. NSRESULT,
  12. IGNORE;
  13. String nativeValue() {
  14. return "mozilla::jni::ExceptionMode::" + name();
  15. }
  16. }
  17. public enum CallingThread {
  18. GECKO,
  19. UI,
  20. ANY;
  21. String nativeValue() {
  22. return "mozilla::jni::CallingThread::" + name();
  23. }
  24. }
  25. public enum DispatchTarget {
  26. GECKO,
  27. PROXY,
  28. CURRENT;
  29. String nativeValue() {
  30. return "mozilla::jni::DispatchTarget::" + name();
  31. }
  32. }
  33. public final String wrapperName;
  34. public final ExceptionMode exceptionMode;
  35. public final CallingThread callingThread;
  36. public final DispatchTarget dispatchTarget;
  37. public AnnotationInfo(String wrapperName, ExceptionMode exceptionMode,
  38. CallingThread callingThread, DispatchTarget dispatchTarget) {
  39. this.wrapperName = wrapperName;
  40. this.exceptionMode = exceptionMode;
  41. this.callingThread = callingThread;
  42. this.dispatchTarget = dispatchTarget;
  43. }
  44. }