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.betwixt.io;
  17. /**
  18. * <p>Thrown when bean evaluation finds a cycle reference.</p>
  19. *
  20. * <p>There are two possible behaviours that <code>Betwixt</code> adopts when
  21. * a cycle in the object graph is encountered.
  22. *
  23. * <p>If <code>ID</code> attributes are being generated,
  24. * then the recursion will stop and the <code>IDREF</code> attribute will be
  25. * written.
  26. * In this case, <em>no exception will be thrown</em>.</p>
  27. *
  28. * <p>If <code>ID</code> are <strong>not</strong> being generated,
  29. * then this exception will be thrown.</p>
  30. *
  31. * @author <a href="mailto:rdonkin@apache.org">Robert Burrell Donkin</a>
  32. * @version $Revision: 1.6 $
  33. */
  34. public class CyclicReferenceException extends RuntimeException {
  35. /** Message used with empty constructor */
  36. private static final String DEFAULT_MESSAGE
  37. = "Bean graph contains a cyclic reference";
  38. /** Construct exception with default message.
  39. */
  40. public CyclicReferenceException() {
  41. super(DEFAULT_MESSAGE);
  42. }
  43. /**
  44. * Construct exception with message
  45. *
  46. * @param message the detailed message string
  47. */
  48. public CyclicReferenceException(String message) {
  49. super(message);
  50. }
  51. }