1. /*
  2. * Copyright 2001-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.apache.commons.beanutils;
  17. /**
  18. * <p>A <strong>ConversionException</strong> indicates that a call to
  19. * <code>Converter.convert()</code> has failed to complete successfully.
  20. *
  21. * @author Craig McClanahan
  22. * @author Paulo Gaspar
  23. * @since 1.3
  24. */
  25. public class ConversionException extends RuntimeException {
  26. // ----------------------------------------------------------- Constructors
  27. /**
  28. * Construct a new exception with the specified message.
  29. *
  30. * @param message The message describing this exception
  31. */
  32. public ConversionException(String message) {
  33. super(message);
  34. }
  35. /**
  36. * Construct a new exception with the specified message and root cause.
  37. *
  38. * @param message The message describing this exception
  39. * @param cause The root cause of this exception
  40. */
  41. public ConversionException(String message, Throwable cause) {
  42. super(message);
  43. this.cause = cause;
  44. }
  45. /**
  46. * Construct a new exception with the specified root cause.
  47. *
  48. * @param cause The root cause of this exception
  49. */
  50. public ConversionException(Throwable cause) {
  51. super(cause.getMessage());
  52. this.cause = cause;
  53. }
  54. // ------------------------------------------------------------- Properties
  55. /**
  56. * The root cause of this <code>ConversionException</code>, compatible with
  57. * JDK 1.4's extensions to <code>java.lang.Throwable</code>.
  58. */
  59. protected Throwable cause = null;
  60. public Throwable getCause() {
  61. return (this.cause);
  62. }
  63. }