You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ThrowsTagImpl.java 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* -*- Mode: JDE; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. *
  3. * This file is part of the debugger and core tools for the AspectJ(tm)
  4. * programming language; see http://aspectj.org
  5. *
  6. * The contents of this file are subject to the Mozilla Public License
  7. * Version 1.1 (the "License"); you may not use this file except in
  8. * compliance with the License. You may obtain a copy of the License at
  9. * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
  10. *
  11. * Software distributed under the License is distributed on an "AS IS" basis,
  12. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. * for the specific language governing rights and limitations under the
  14. * License.
  15. *
  16. * The Original Code is AspectJ.
  17. *
  18. * The Initial Developer of the Original Code is Xerox Corporation. Portions
  19. * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
  20. * All Rights Reserved.
  21. */
  22. package org.aspectj.tools.ajdoc;
  23. import com.sun.javadoc.ClassDoc;
  24. import com.sun.javadoc.Doc;
  25. import com.sun.javadoc.ThrowsTag;
  26. import java.util.Locale;
  27. /**
  28. * Represents a throws tag in the aspectj-world.
  29. *
  30. * @author Jeff Palm
  31. */
  32. public class ThrowsTagImpl extends TagImpl implements ThrowsTag {
  33. private ClassDoc exception;
  34. private String exceptionComment;
  35. private String exceptionName;
  36. /**
  37. * Constructs the new tag with given parameters and
  38. * splits the text.
  39. *
  40. * @param doc the new value for <code>doc</code>.
  41. * @param name the new value for <code>name</code>.
  42. * @param text the new value for <code>text</code>.
  43. * @param locale the new value for <code>locale</code>.
  44. * @param err the new value for <code>err</code>.
  45. */
  46. public ThrowsTagImpl(Doc doc,
  47. String name,
  48. String text,
  49. Locale loc,
  50. ErrPrinter err) {
  51. super(doc, name, text, loc, err);
  52. String[] split = split(text);
  53. exceptionName = split[0];
  54. exceptionComment = split[1];
  55. exception = findException();
  56. }
  57. /**
  58. * Returns the exception thrown.
  59. *
  60. * @return a ClassDoc that represents the thrown exception.
  61. */
  62. public ClassDoc exception() {
  63. return exception;
  64. }
  65. /**
  66. * Returns the comment text.
  67. *
  68. * @return a String of the comment text.
  69. */
  70. public String exceptionComment() {
  71. return exceptionComment;
  72. }
  73. /**
  74. * Returns the name of the type of exception thrown.
  75. *
  76. * @return a String name of the type of exception thrown.
  77. */
  78. public String exceptionName() {
  79. return exceptionName;
  80. }
  81. /**
  82. * Returns <code>throws</code>.
  83. *
  84. * @return <code>throws</code>.
  85. */
  86. public String kind() {
  87. return "@throws";
  88. }
  89. //XXX
  90. //TODO: implement FUUUUUUCCCCCCCCCKKKKKKKKKKKK
  91. private ClassDoc findException() {
  92. return null;
  93. }
  94. }