1. /*
  2. * Copyright 1999-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. /*
  17. * $Id: SynthesisException.java,v 1.6 2004/02/17 04:23:24 minchau Exp $
  18. */
  19. package com.sun.org.apache.xml.internal.utils.synthetic;
  20. /**
  21. * Class SynthesisException <needs-comment/>
  22. * @xsl.usage internal
  23. */
  24. public class SynthesisException extends Exception
  25. {
  26. /** Field code.
  27. * @serial */
  28. int code;
  29. // Manefest constants
  30. /** Field SYNTAX */
  31. public static final int SYNTAX = 0;
  32. /** Field UNSUPPORTED */
  33. public static final int UNSUPPORTED = 1;
  34. /** Field REIFIED */
  35. public static final int REIFIED = 2;
  36. /** Field UNREIFIED */
  37. public static final int UNREIFIED = 3;
  38. /** Field WRONG_OWNER */
  39. public static final int WRONG_OWNER = 4;
  40. /** Field errToString */
  41. public static final String[] errToString = {
  42. "(Syntax error; specific message should be passed in)",
  43. "Feature not yet supported",
  44. "Can't change features of 'real' class",
  45. "Can't yet instantiate/invoke without 'real' class",
  46. "Can't add Member to an object other than its declarer", };
  47. /**
  48. * Constructor SynthesisException
  49. *
  50. *
  51. * @param code
  52. */
  53. public SynthesisException(int code)
  54. {
  55. super(errToString[code]);
  56. this.code = code;
  57. }
  58. /**
  59. * Constructor SynthesisException
  60. *
  61. *
  62. * @param code
  63. * @param msg
  64. */
  65. public SynthesisException(int code, String msg)
  66. {
  67. super(msg);
  68. this.code = code;
  69. }
  70. /**
  71. * Method getCode
  72. *
  73. *
  74. */
  75. int getCode()
  76. {
  77. return code;
  78. }
  79. }