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.

MethodSubWriter.java 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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.doclets.standard;
  23. import org.aspectj.ajdoc.AdviceDoc;
  24. import com.sun.javadoc.ClassDoc;
  25. import com.sun.javadoc.ExecutableMemberDoc;
  26. import com.sun.javadoc.MethodDoc;
  27. import com.sun.javadoc.ProgramElementDoc;
  28. import com.sun.tools.doclets.VisibleMemberMap;
  29. public class MethodSubWriter extends ExecutableMemberSubWriter {
  30. public static class Del
  31. extends com.sun.tools.doclets.standard.MethodSubWriter {
  32. protected MethodSubWriter mw;
  33. public Del(com.sun.tools.doclets.standard.SubWriterHolderWriter writer,
  34. ClassDoc classdoc)
  35. {
  36. super(writer, classdoc);
  37. }
  38. public Del(com.sun.tools.doclets.standard.SubWriterHolderWriter writer)
  39. {
  40. super(writer);
  41. }
  42. public void printMembersSummary() {
  43. mw.printMembersSummary();
  44. mw.printIntroducedMembersSummary();
  45. }
  46. public void printMembers() {
  47. mw.printMembers();
  48. }
  49. protected void navSummaryLink() {
  50. mw.navSummaryLink();
  51. }
  52. protected void navDetailLink() {
  53. mw.navDetailLink();
  54. }
  55. public void setDelegator(MethodSubWriter mw) { this.mw = mw; }
  56. public void printSummaryMember(ClassDoc cd, ProgramElementDoc member) {
  57. mw.printSummaryMember(cd, member);
  58. }
  59. }
  60. protected Class delegateClass() { return Del.class; }
  61. public MethodSubWriter
  62. (com.sun.tools.doclets.standard.SubWriterHolderWriter writer,
  63. ClassDoc classdoc)
  64. {
  65. super(writer, classdoc);
  66. }
  67. public MethodSubWriter
  68. (com.sun.tools.doclets.standard.SubWriterHolderWriter writer)
  69. {
  70. super(writer);
  71. }
  72. public int getMemberKind() {
  73. //XXX hack!!!
  74. return VisibleMemberMap.METHODS;
  75. }
  76. //XXX
  77. //hacks
  78. protected void printSummaryType(ProgramElementDoc member) {
  79. if (member instanceof MethodDoc) {
  80. //TODO: Put in Access...
  81. MethodDoc meth = (MethodDoc)member;
  82. printModifierAndType(meth, meth.returnType());
  83. } else if (member instanceof AdviceDoc) {
  84. AdviceDoc advice = (AdviceDoc)member;
  85. printModifierAndType(advice, advice.returnType());
  86. }
  87. }
  88. protected void printSignature(ExecutableMemberDoc member) {
  89. writer.displayLength = 0;
  90. writer.pre();
  91. printModifiers(member);
  92. //printReturnType((MethodDoc)member);
  93. bold(member.name());
  94. // printParameters(member);
  95. // printExceptions(member);
  96. writer.preEnd();
  97. }
  98. //end-hacks
  99. protected String propertyName() { return "Method"; }
  100. }