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.

ClassSubWriter.java 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.AspectDoc;
  24. import com.sun.javadoc.ClassDoc;
  25. import com.sun.javadoc.ProgramElementDoc;
  26. import com.sun.javadoc.Type;
  27. import com.sun.tools.doclets.VisibleMemberMap;
  28. public class ClassSubWriter extends AbstractSubWriter {
  29. public static class Del extends com.sun.tools.doclets.standard.ClassSubWriter {
  30. protected ClassSubWriter mw;
  31. public Del(com.sun.tools.doclets.standard.SubWriterHolderWriter writer,
  32. ClassDoc classdoc)
  33. {
  34. super(writer, classdoc);
  35. }
  36. public Del(com.sun.tools.doclets.standard.SubWriterHolderWriter writer)
  37. {
  38. super(writer);
  39. }
  40. public void printMembersSummary() {
  41. mw.printMembersSummary();
  42. mw.printIntroducedMembersSummary();
  43. if (writer instanceof ClassWriter) {
  44. ((ClassWriter)writer).printAspectJSummary();
  45. }
  46. }
  47. public void printMembers() {
  48. mw.printMembers();
  49. }
  50. protected void navSummaryLink() {
  51. mw.navSummaryLink();
  52. if (writer instanceof ClassWriter) {
  53. ((ClassWriter)writer).navstate++;
  54. }
  55. }
  56. protected void navDetailLink() {
  57. mw.navDetailLink();
  58. }
  59. public void setDelegator(ClassSubWriter mw) { this.mw = mw; }
  60. }
  61. protected Class delegateClass() {
  62. return Del.class;
  63. }
  64. public ClassSubWriter
  65. (com.sun.tools.doclets.standard.SubWriterHolderWriter writer,
  66. ClassDoc classdoc)
  67. {
  68. super(writer, classdoc);
  69. }
  70. public ClassSubWriter
  71. (com.sun.tools.doclets.standard.SubWriterHolderWriter writer)
  72. {
  73. super(writer);
  74. }
  75. public int getMemberKind() {
  76. //XXX hack!!!
  77. return VisibleMemberMap.INNERCLASSES;
  78. }
  79. protected void printSummaryType(ProgramElementDoc member) {
  80. ClassDoc cd = (ClassDoc)member;
  81. printModifierAndType(cd, null);
  82. }
  83. protected void printModifierAndType(ProgramElementDoc member,
  84. Type type) {
  85. writer.printTypeSummaryHeader();
  86. printModifier(member);
  87. if (type == null) {
  88. print(member instanceof AspectDoc ?
  89. "aspect" : member.isClass() ?
  90. "class" :
  91. "interface");
  92. } else {
  93. printTypeLink(type);
  94. }
  95. writer.printTypeSummaryFooter();
  96. }
  97. }