RuntimeException.hx 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package java.lang;
  2. /*
  3. * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  4. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5. *
  6. * This code is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 only, as
  8. * published by the Free Software Foundation. Oracle designates this
  9. * particular file as subject to the "Classpath" exception as provided
  10. * by Oracle in the LICENSE file that accompanied this code.
  11. *
  12. * This code is distributed in the hope that it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  15. * version 2 for more details (a copy is included in the LICENSE file that
  16. * accompanied this code).
  17. *
  18. * You should have received a copy of the GNU General Public License version
  19. * 2 along with this work; if not, write to the Free Software Foundation,
  20. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21. *
  22. * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  23. * or visit www.oracle.com if you need additional information or have any
  24. * questions.
  25. */
  26. /**
  27. * {@code RuntimeException} is the superclass of those
  28. * exceptions that can be thrown during the normal operation of the
  29. * Java Virtual Machine.
  30. *
  31. * <p>{@code RuntimeException} and its subclasses are <em>unchecked
  32. * exceptions</em>. Unchecked exceptions do <em>not</em> need to be
  33. * declared in a method or constructor's {@code throws} clause if they
  34. * can be thrown by the execution of the method or constructor and
  35. * propagate outside the method or constructor boundary.
  36. *
  37. * @author Frank Yellin
  38. * @jls 11.2 Compile-Time Checking of Exceptions
  39. * @since JDK1.0
  40. */
  41. @:require(java0) extern class RuntimeException extends java.lang.Exception
  42. {
  43. /** Constructs a new runtime exception with {@code null} as its
  44. * detail message. The cause is not initialized, and may subsequently be
  45. * initialized by a call to {@link #initCause}.
  46. */
  47. @:overload public function new() : Void;
  48. /** Constructs a new runtime exception with the specified detail message.
  49. * The cause is not initialized, and may subsequently be initialized by a
  50. * call to {@link #initCause}.
  51. *
  52. * @param message the detail message. The detail message is saved for
  53. * later retrieval by the {@link #getMessage()} method.
  54. */
  55. @:overload public function new(message : String) : Void;
  56. /**
  57. * Constructs a new runtime exception with the specified detail message and
  58. * cause. <p>Note that the detail message associated with
  59. * {@code cause} is <i>not</i> automatically incorporated in
  60. * this runtime exception's detail message.
  61. *
  62. * @param message the detail message (which is saved for later retrieval
  63. * by the {@link #getMessage()} method).
  64. * @param cause the cause (which is saved for later retrieval by the
  65. * {@link #getCause()} method). (A <tt>null</tt> value is
  66. * permitted, and indicates that the cause is nonexistent or
  67. * unknown.)
  68. * @since 1.4
  69. */
  70. @:require(java4) @:overload public function new(message : String, cause : java.lang.Throwable) : Void;
  71. /** Constructs a new runtime exception with the specified cause and a
  72. * detail message of <tt>(cause==null ? null : cause.toString())</tt>
  73. * (which typically contains the class and detail message of
  74. * <tt>cause</tt>). This constructor is useful for runtime exceptions
  75. * that are little more than wrappers for other throwables.
  76. *
  77. * @param cause the cause (which is saved for later retrieval by the
  78. * {@link #getCause()} method). (A <tt>null</tt> value is
  79. * permitted, and indicates that the cause is nonexistent or
  80. * unknown.)
  81. * @since 1.4
  82. */
  83. @:require(java4) @:overload public function new(cause : java.lang.Throwable) : Void;
  84. /**
  85. * Constructs a new runtime exception with the specified detail
  86. * message, cause, suppression enabled or disabled, and writable
  87. * stack trace enabled or disabled.
  88. *
  89. * @param message the detail message.
  90. * @param cause the cause. (A {@code null} value is permitted,
  91. * and indicates that the cause is nonexistent or unknown.)
  92. * @param enableSuppression whether or not suppression is enabled
  93. * or disabled
  94. * @param writableStackTrace whether or not the stack trace should
  95. * be writable
  96. *
  97. * @since 1.7
  98. */
  99. @:require(java7) @:overload private function new(message : String, cause : java.lang.Throwable, enableSuppression : Bool, writableStackTrace : Bool) : Void;
  100. }