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.

HtmlDecorator.java 39KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005
  1. /* *******************************************************************
  2. * Copyright (c) 1999-2001 Xerox Corporation,
  3. * 2002 Palo Alto Research Center, Incorporated (PARC).
  4. * All rights reserved.
  5. * This program and the accompanying materials are made available
  6. * under the terms of the Eclipse Public License v 2.0
  7. * which accompanies this distribution and is available at
  8. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  9. *
  10. * Contributors:
  11. * Xerox/PARC initial implementation
  12. * Mik Kersten port to AspectJ 1.1+ code base
  13. * ******************************************************************/
  14. package org.aspectj.tools.ajdoc;
  15. import java.io.BufferedReader;
  16. import java.io.DataInputStream;
  17. import java.io.File;
  18. import java.io.FileOutputStream;
  19. import java.io.FileReader;
  20. import java.io.IOException;
  21. import java.io.StringReader;
  22. import java.util.ArrayList;
  23. import java.util.Hashtable;
  24. import java.util.Iterator;
  25. import java.util.List;
  26. import java.util.StringTokenizer;
  27. import org.aspectj.asm.AsmManager;
  28. import org.aspectj.asm.HierarchyWalker;
  29. import org.aspectj.asm.IProgramElement;
  30. import org.aspectj.asm.IRelationship;
  31. import org.aspectj.util.LangUtil;
  32. import org.aspectj.util.TypeSafeEnum;
  33. /**
  34. * @author Mik Kersten
  35. */
  36. class HtmlDecorator {
  37. public static final String TYPE_NAME_LABEL;
  38. public static final String CLOSING_SPAN;
  39. static {
  40. if (LangUtil.is16VMOrGreater())
  41. TYPE_NAME_LABEL = "element-name type-name-label";
  42. else if (LangUtil.is15VMOrGreater())
  43. TYPE_NAME_LABEL = "type-name-label";
  44. else if (LangUtil.is1dot8VMOrGreater())
  45. TYPE_NAME_LABEL = "typeNameLabel";
  46. else
  47. TYPE_NAME_LABEL = "strong";
  48. if (LangUtil.is16VMOrGreater())
  49. CLOSING_SPAN = "</span>";
  50. else
  51. CLOSING_SPAN = "";
  52. }
  53. private static final String POINTCUT_DETAIL = "Pointcut Detail";
  54. private static final String ADVICE_DETAIL = "Advice Detail";
  55. private static final String DECLARE_DETAIL = "Declare Detail";
  56. private static final String ADVICE_SUMMARY = "Advice Summary";
  57. private static final String POINTCUT_SUMMARY = "Pointcut Summary";
  58. private static final String DECLARE_SUMMARY = "Declare Summary";
  59. private static final String ITD_METHOD_SUMMARY = "Inter-Type Method Summary";
  60. private static final String ITD_FIELD_SUMMARY = "Inter-Type Field Summary";
  61. private static final String ITD_CONSTRUCTOR_SUMMARY = "Inter-Type Constructor Summary";
  62. static List<String> visibleFileList = new ArrayList<>();
  63. static Hashtable declIDTable = null;
  64. static File rootDir = null;
  65. static String docVisibilityModifier;
  66. static void decorateHTMLFromInputFiles(AsmManager model, Hashtable table, File newRootDir, File[] inputFiles, String docModifier)
  67. throws IOException {
  68. rootDir = newRootDir;
  69. declIDTable = table;
  70. docVisibilityModifier = docModifier;
  71. for (File inputFile : inputFiles) {
  72. decorateHTMLFromIPEs(getProgramElements(model, inputFile.getCanonicalPath()), rootDir.getCanonicalPath()
  73. + Config.DIR_SEP_CHAR, docModifier, false);
  74. }
  75. }
  76. static void decorateHTMLFromIPEs(IProgramElement[] decls, String base, String docModifier, boolean exceededNestingLevel)
  77. throws IOException {
  78. if (decls != null) {
  79. for (IProgramElement decl : decls) {
  80. decorateHTMLFromIPE(decl, base, docModifier, exceededNestingLevel);
  81. }
  82. }
  83. }
  84. /**
  85. * Before attempting to decorate the HTML file we have to verify that it exists, which depends on the documentation visibility
  86. * specified to c.
  87. *
  88. * Depending on docModifier, can document - public: only public - protected: protected and public (default) - package: package
  89. * protected and public - private: everything
  90. */
  91. static void decorateHTMLFromIPE(IProgramElement decl, String base, String docModifier, boolean exceededNestingLevel)
  92. throws IOException {
  93. boolean nestedClass = false;
  94. if (decl.getKind().isType()) {
  95. boolean decorateFile = true;
  96. if (isAboveVisibility(decl)) {
  97. visibleFileList.add(decl.toSignatureString());
  98. String packageName = decl.getPackageName();
  99. String filename = "";
  100. if (packageName != null) {
  101. int index1 = base.lastIndexOf(Config.DIR_SEP_CHAR);
  102. int index2 = base.lastIndexOf(".");
  103. String currFileClass = "";
  104. if (index1 > -1 && index2 > 0 && index1 < index2) {
  105. currFileClass = base.substring(index1 + 1, index2);
  106. }
  107. // XXX only one level of nexting
  108. if (currFileClass.equals(decl.getDeclaringType())) {
  109. nestedClass = true;
  110. packageName = packageName.replace('.', '/');
  111. String newBase = "";
  112. if (base.lastIndexOf(Config.DIR_SEP_CHAR) > 0) {
  113. newBase = base.substring(0, base.lastIndexOf(Config.DIR_SEP_CHAR));
  114. }
  115. String signature = constructNestedTypeName(decl);
  116. filename = newBase + Config.DIR_SEP_CHAR + packageName + Config.DIR_SEP_CHAR + currFileClass + // "." +
  117. signature + ".html";
  118. } else {
  119. packageName = packageName.replace('.', '/');
  120. filename = base + packageName + Config.DIR_SEP_CHAR + decl.toSignatureString() + ".html";
  121. }
  122. } else {
  123. filename = base + decl.toSignatureString() + ".html";
  124. }
  125. if (!exceededNestingLevel) {
  126. decorateHTMLFile(new File(filename));
  127. } else {
  128. System.out.println("Warning: can not generate documentation for nested " + "inner class: "
  129. + decl.toSignatureString());
  130. }
  131. }
  132. }
  133. }
  134. private static String constructNestedTypeName(IProgramElement node) {
  135. if (node.getParent().getKind().isSourceFile()) {
  136. return node.getName();
  137. } else {
  138. String nodeName = "";
  139. if (node.getKind().isType())
  140. nodeName += '.' + node.getName();
  141. return constructNestedTypeName(node.getParent()) + nodeName;
  142. }
  143. }
  144. /**
  145. * Skips files that are public in the model but not public in the source, e.g. nested aspects.
  146. */
  147. static void decorateHTMLFile(File file) throws IOException {
  148. if (!file.exists())
  149. return;
  150. System.out.println("> Decorating " + file.getCanonicalPath() + "...");
  151. BufferedReader reader = new BufferedReader(new FileReader(file));
  152. StringBuffer fileContents = new StringBuffer();
  153. String line = reader.readLine();
  154. while (line != null) {
  155. fileContents.append(line + "\n");
  156. line = reader.readLine();
  157. }
  158. boolean isSecond = false;
  159. int index = 0;
  160. IProgramElement decl;
  161. while (true) {
  162. // ---this next part is an inlined procedure that returns two values---
  163. // ---the next declaration and the index at which that declaration's---
  164. // ---DeclID sits in the .html file ---
  165. String contents = fileContents.toString();
  166. int start = contents.indexOf(Config.DECL_ID_STRING, index);
  167. int end = contents.indexOf(Config.DECL_ID_TERMINATOR, index);
  168. if (start == -1)
  169. decl = null;
  170. else if (end == -1)
  171. throw new Error("Malformed DeclID.");
  172. else {
  173. String tid = contents.substring(start + Config.DECL_ID_STRING.length(), end);
  174. decl = (IProgramElement) declIDTable.get(tid);
  175. index = start;
  176. }
  177. // --- ---
  178. // --- ---
  179. if (decl == null)
  180. break;
  181. fileContents.delete(start, end + Config.DECL_ID_TERMINATOR.length());
  182. if (decl.getKind().isType()) {
  183. isSecond = true;
  184. String fullname = "";
  185. if (decl.getParent().getKind().equals(IProgramElement.Kind.ASPECT)
  186. || decl.getParent().getKind().equals(IProgramElement.Kind.CLASS)) {
  187. fullname += decl.getParent().toSignatureString().concat(".").concat(decl.toSignatureString());
  188. } else {
  189. fullname += decl.toSignatureString();
  190. }
  191. // only add aspect documentation if we're in the correct
  192. // file for the given IProgramElement
  193. if (file.getName().contains(fullname + ".html")) {
  194. addAspectDocumentation(decl, fileContents, index);
  195. }
  196. } else {
  197. decorateMemberDocumentation(decl, fileContents, index);
  198. }
  199. // Change "Class" to "Aspect"
  200. // moved this here because then can use the IProgramElement.Kind
  201. // rather than checking to see if there's advice - this fixes
  202. // the case with an inner aspect not having the title "Aspect"
  203. if (decl.getKind().equals(IProgramElement.Kind.ASPECT) && file.getName().contains(decl.toSignatureString())) {
  204. // only want to change "Class" to "Aspect" if we're in the
  205. // file corresponding to the IProgramElement
  206. String fullname = "";
  207. if (decl.getParent().getKind().equals(IProgramElement.Kind.ASPECT)
  208. || decl.getParent().getKind().equals(IProgramElement.Kind.CLASS)) {
  209. fullname += decl.getParent().toSignatureString().concat(".").concat(decl.toSignatureString());
  210. } else {
  211. fullname += decl.toSignatureString();
  212. }
  213. if (!file.getName().contains(fullname + ".html")) {
  214. // we're still in the file for a parent IPE
  215. continue;
  216. }
  217. boolean br = true;
  218. contents = fileContents.toString();
  219. int classStartIndex = contents.indexOf("<BR>\nClass ");
  220. if (classStartIndex == -1) {
  221. classStartIndex = contents.indexOf("<H2>\nClass ");
  222. br = false;
  223. }
  224. if (classStartIndex == -1) {
  225. // Java8 looks more like this:
  226. // <h2 title="Class A" class="title">Class A</h2>
  227. classStartIndex = contents.indexOf("<h2 title=\"Class ");
  228. int classEndIndex = contents.indexOf("</h2>", classStartIndex);
  229. if (classStartIndex == -1) {
  230. // Java 13 - replaced h2 with h1 here
  231. classStartIndex = contents.indexOf("<h1 title=\"Class ");
  232. classEndIndex = contents.indexOf("</h1>", classStartIndex);
  233. }
  234. if (classEndIndex != -1) {
  235. // Convert it to "<h2 title="Aspect A" class="title">Aspect A</h2>"
  236. String classLine = contents.substring(classStartIndex, classEndIndex);
  237. String aspectLine = classLine.replaceAll("Class ","Aspect ");
  238. fileContents.delete(classStartIndex, classEndIndex);
  239. fileContents.insert(classStartIndex, aspectLine);
  240. }
  241. }
  242. else if (classStartIndex != -1) {
  243. contents = fileContents.toString();
  244. int classEndIndex = contents.indexOf("</H2>", classStartIndex);
  245. if (classEndIndex != -1) {
  246. String classLine = contents.substring(classStartIndex, classEndIndex);
  247. String aspectLine = "";
  248. if (br) {
  249. aspectLine += "<BR>\n" + "Aspect " + classLine.substring(11, classLine.length());
  250. } else {
  251. aspectLine += "<H2>\n" + "Aspect " + classLine.substring(11, classLine.length());
  252. }
  253. fileContents.delete(classStartIndex, classEndIndex);
  254. fileContents.insert(classStartIndex, aspectLine);
  255. }
  256. }
  257. contents = fileContents.toString();
  258. int secondClassStartIndex = contents.indexOf("class <B>");
  259. if (secondClassStartIndex != -1) {
  260. String name = decl.toSignatureString();
  261. int classEndIndex = contents.indexOf(name + "</B><DT>");
  262. if (classEndIndex != -1) {
  263. StringBuilder sb = new StringBuilder(contents.substring(secondClassStartIndex, classEndIndex));
  264. sb.replace(0, 5, "aspect");
  265. fileContents.delete(secondClassStartIndex, classEndIndex);
  266. fileContents.insert(secondClassStartIndex, sb.toString());
  267. }
  268. }
  269. else {
  270. contents = fileContents.toString();
  271. // Java16: <span class="modifiers">static class </span><span class="type-name-label">ClassA.InnerAspect</span>
  272. // Java15: <pre>static class <span class="type-name-label">ClassA.InnerAspect</span>
  273. // Java8: <pre>static class <span class="typeNameLabel">ClassA.InnerAspect</span>
  274. // Java7 (464604): <pre>public class <span class="strong">Azpect</span>
  275. String startString = "class " + CLOSING_SPAN + "<span class=\"";
  276. classStartIndex = contents.indexOf(startString + TYPE_NAME_LABEL + "\">");
  277. int classEndIndex = contents.indexOf("</span>", classStartIndex + startString.length());
  278. // This is where after Java version upgrades usually tests fail or the first time.
  279. // Logging context information helps fixing the issue quickly.
  280. if (classStartIndex == -1 || classEndIndex == -1) {
  281. System.out.println(
  282. "Something unexpected went wrong in HtmlDecorator. Here is the full file causing the problem:\n\n" +
  283. "------------------------------------------------------------------------\n\n" +
  284. contents + "\n" +
  285. "------------------------------------------------------------------------\n"
  286. );
  287. }
  288. if (classEndIndex != -1) {
  289. // Convert it to "aspect <span class="TYPE_NAME_LABEL">ClassA.InnerAspect</span>"
  290. String aspectLine = "aspect" + contents.substring(classStartIndex + 5, classEndIndex);
  291. fileContents.delete(classStartIndex, classEndIndex);
  292. fileContents.insert(classStartIndex, aspectLine);
  293. }
  294. }
  295. }
  296. }
  297. file.delete();
  298. FileOutputStream fos = new FileOutputStream(file);
  299. fos.write(fileContents.toString().getBytes());
  300. reader.close();
  301. fos.close();
  302. }
  303. static void addAspectDocumentation(IProgramElement node, StringBuffer fileBuffer, int index) {
  304. List<IProgramElement> pointcuts = new ArrayList<>();
  305. List<IProgramElement> advice = new ArrayList<>();
  306. List<IProgramElement> declares = new ArrayList<>();
  307. List<IProgramElement> methodsDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.INTER_TYPE_METHOD);
  308. if (methodsDeclaredOn != null && !methodsDeclaredOn.isEmpty()) {
  309. insertDeclarationsSummary(fileBuffer, methodsDeclaredOn, ITD_METHOD_SUMMARY, index);
  310. }
  311. List<IProgramElement> fieldsDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.INTER_TYPE_FIELD);
  312. if (fieldsDeclaredOn != null && !fieldsDeclaredOn.isEmpty()) {
  313. insertDeclarationsSummary(fileBuffer, fieldsDeclaredOn, ITD_FIELD_SUMMARY, index);
  314. }
  315. List<IProgramElement> constDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR);
  316. if (fieldsDeclaredOn != null && !constDeclaredOn.isEmpty()) {
  317. insertDeclarationsSummary(fileBuffer, constDeclaredOn, ITD_CONSTRUCTOR_SUMMARY, index);
  318. }
  319. for (IProgramElement member : node.getChildren()) {
  320. if (member.getKind().equals(IProgramElement.Kind.POINTCUT)) {
  321. pointcuts.add(member);
  322. } else if (member.getKind().equals(IProgramElement.Kind.ADVICE)) {
  323. advice.add(member);
  324. } else if (member.getKind().isDeclare() || member.getKind().isInterTypeMember()) {
  325. declares.add(member);
  326. }
  327. }
  328. if (declares.size() > 0) {
  329. insertDeclarationsDetails(fileBuffer, declares, DECLARE_DETAIL, index);
  330. insertDeclarationsSummary(fileBuffer, declares, DECLARE_SUMMARY, index);
  331. }
  332. if (pointcuts.size() > 0) {
  333. insertDeclarationsSummary(fileBuffer, pointcuts, POINTCUT_SUMMARY, index);
  334. insertDeclarationsDetails(fileBuffer, pointcuts, POINTCUT_DETAIL, index);
  335. }
  336. if (advice.size() > 0) {
  337. insertDeclarationsSummary(fileBuffer, advice, ADVICE_SUMMARY, index);
  338. insertDeclarationsDetails(fileBuffer, advice, ADVICE_DETAIL, index);
  339. }
  340. // add the 'aspect declarations' information against the type
  341. List<IProgramElement> parentsDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.DECLARE_PARENTS);
  342. if (parentsDeclaredOn != null && parentsDeclaredOn.size() > 0) {
  343. decorateDocWithRel(node, fileBuffer, index, parentsDeclaredOn, HtmlRelationshipKind.ASPECT_DECLARATIONS);
  344. }
  345. // add the 'annotated by' information against the type
  346. List<String> annotatedBy = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE_INTER_TYPE, "annotated by");
  347. if (annotatedBy != null && annotatedBy.size() > 0) {
  348. decorateDocWithRel(node, fileBuffer, index, annotatedBy, HtmlRelationshipKind.ANNOTATED_BY);
  349. }
  350. // add the 'advised by' information against the type
  351. List<String> advisedBy = StructureUtil.getTargets(node, IRelationship.Kind.ADVICE);
  352. if (advisedBy != null && advisedBy.size() > 0) {
  353. decorateDocWithRel(node, fileBuffer, index, advisedBy, HtmlRelationshipKind.ADVISED_BY);
  354. }
  355. }
  356. static void insertDeclarationsSummary(StringBuffer fileBuffer, List decls, String kind, int index) {
  357. if (!declsAboveVisibilityExist(decls))
  358. return;
  359. int insertIndex = findSummaryIndex(fileBuffer, index);
  360. // insert the head of the table
  361. String tableHead = "<!-- ======== " + kind.toUpperCase() + " ======= -->\n\n"
  362. + "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"1\""
  363. + "CELLSPACING=\"0\"><TR><TD COLSPAN=2 BGCOLOR=\"#CCCCFF\">" + "<FONT SIZE=\"+2\"><B>" + kind
  364. + "</B></FONT></TD></TR>\n";
  365. fileBuffer.insert(insertIndex, tableHead);
  366. insertIndex += tableHead.length();
  367. // insert the body of the table
  368. for (Object o : decls) {
  369. IProgramElement decl = (IProgramElement) o;
  370. if (isAboveVisibility(decl)) {
  371. // insert the table row accordingly
  372. String comment = generateSummaryComment(decl);
  373. String entry = "";
  374. if (kind.equals(ADVICE_SUMMARY)) {
  375. entry += "<TR><TD>" + "<A HREF=\"#" + generateHREFName(decl) + "\">" + "<TT>" + generateSignatures(decl)
  376. + "</TT></A><BR>&nbsp;";
  377. if (!comment.equals("")) {
  378. entry += comment + "<P>";
  379. }
  380. entry += generateAffects(decl) + "</TD>" + "</TR><TD>\n";
  381. } else if (kind.equals(POINTCUT_SUMMARY)) {
  382. entry += "<TR><TD WIDTH=\"1%\">" + "<FONT SIZE=-1><TT>" + genAccessibility(decl) + "</TT></FONT>" + "</TD>\n"
  383. + "<TD>" + "<TT><A HREF=\"#" + generateHREFName(decl) + "\">" + decl.toLabelString()
  384. + "</A></TT><BR>&nbsp;";
  385. if (!comment.equals("")) {
  386. entry += comment + "<P>";
  387. }
  388. entry += "</TR></TD>\n";
  389. } else if (kind.equals(DECLARE_SUMMARY)) {
  390. entry += "<TR><TD WIDTH=\"1%\">" + "<FONT SIZE=-1><TT>" + generateModifierInformation(decl, false)
  391. + "</TT></FONT>" + "</TD>" + "<TD>" + "<A HREF=\"#" + generateHREFName(decl) + "\">" + "<TT>"
  392. + decl.toLabelString() + "</TT></A><P>" + generateAffects(decl);
  393. } else if (kind.equals(ITD_FIELD_SUMMARY) || kind.equals(ITD_METHOD_SUMMARY)) {
  394. entry += "<TR><TD WIDTH=\"1%\">" + "<FONT SIZE=-1><TT>" + generateModifierInformation(decl, false)
  395. + "</TT></FONT>" + "</TD>" + "<TD>" + "<A HREF=\"#" + generateHREFName(decl) + "\">" + "<TT>"
  396. + decl.toLabelString() + "</TT></A><P>" + generateDeclaredBy(decl);
  397. } else if (kind.equals(ITD_CONSTRUCTOR_SUMMARY)) {
  398. entry += "<TD>" + "<A HREF=\"#" + generateHREFName(decl) + "\">" + "<TT>" + decl.toLabelString()
  399. + "</TT></A><P>" + generateDeclaredBy(decl);
  400. }
  401. // insert the entry
  402. fileBuffer.insert(insertIndex, entry);
  403. insertIndex += entry.length();
  404. }
  405. }
  406. // insert the end of the table
  407. String tableTail = "</TABLE><P>&nbsp;\n";
  408. fileBuffer.insert(insertIndex, tableTail);
  409. insertIndex += tableTail.length();
  410. }
  411. private static boolean declsAboveVisibilityExist(List decls) {
  412. boolean exist = false;
  413. for (Object decl : decls) {
  414. IProgramElement element = (IProgramElement) decl;
  415. if (isAboveVisibility(element))
  416. exist = true;
  417. }
  418. return exist;
  419. }
  420. private static boolean isAboveVisibility(IProgramElement element) {
  421. IProgramElement.Accessibility acc = element.getAccessibility();
  422. if (docVisibilityModifier.equals("private")) {
  423. // show all classes and members
  424. return true;
  425. } else if (docVisibilityModifier.equals("package")) {
  426. // show package, protected and public classes and members
  427. return acc.equals(IProgramElement.Accessibility.PACKAGE) || acc.equals(IProgramElement.Accessibility.PROTECTED)
  428. || acc.equals(IProgramElement.Accessibility.PUBLIC);
  429. } else if (docVisibilityModifier.equals("protected")) {
  430. // show protected and public classes and members
  431. return acc.equals(IProgramElement.Accessibility.PROTECTED) || acc.equals(IProgramElement.Accessibility.PUBLIC);
  432. } else if (docVisibilityModifier.equals("public")) {
  433. // show public classes and members
  434. return acc.equals(IProgramElement.Accessibility.PUBLIC);
  435. }
  436. return false;
  437. }
  438. private static String genAccessibility(IProgramElement decl) {
  439. if (decl.getAccessibility().equals(IProgramElement.Accessibility.PACKAGE)) {
  440. return "(package private)";
  441. } else {
  442. return decl.getAccessibility().toString();
  443. }
  444. }
  445. static void insertDeclarationsDetails(StringBuffer fileBuffer, List decls, String kind, int index) {
  446. if (!declsAboveVisibilityExist(decls))
  447. return;
  448. int insertIndex = findDetailsIndex(fileBuffer, index);
  449. // insert the table heading
  450. String detailsHeading = "<P>&nbsp;\n" + "<!-- ======== " + kind.toUpperCase() + " SUMMARY ======= -->\n\n"
  451. + "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\" WIDTH=\"100%\">\n"
  452. + "<TR BGCOLOR=\"#CCCCFF\" CLASS=\"TableHeadingColor\">\n" + "<TD COLSPAN=1><FONT SIZE=\"+2\">\n" + "<B>" + kind
  453. + "</B></FONT></TD>\n" + "</TR>\n" + "</TABLE>";
  454. fileBuffer.insert(insertIndex, detailsHeading);
  455. insertIndex += detailsHeading.length();
  456. // insert the details
  457. for (int i = 0; i < decls.size(); i++) {
  458. IProgramElement decl = (IProgramElement) decls.get(i);
  459. if (isAboveVisibility(decl)) {
  460. String entry = "";
  461. // insert the table row accordingly
  462. entry += "<A NAME=\"" + generateHREFName(decl) + "\"><!-- --></A>\n";
  463. if (kind.equals(ADVICE_DETAIL)) {
  464. entry += "<H3>" + decl.getName() + "</H3><P>";
  465. entry += "<TT>" + generateSignatures(decl) + "</TT>\n" + "<P>" + generateDetailsComment(decl) + "<P>"
  466. + generateAffects(decl);
  467. } else if (kind.equals(POINTCUT_DETAIL)) {
  468. entry += "<H3>" + decl.toLabelString() + "</H3><P>" + generateDetailsComment(decl);
  469. } else if (kind.equals(DECLARE_DETAIL)) {
  470. entry += "<H3>" + decl.toLabelString() + "</H3><P>" + generateModifierInformation(decl, true);
  471. if (!decl.getKind().equals(IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR)) {
  472. entry += "&nbsp;&nbsp;";
  473. }
  474. // if we're not a declare statement then we need to generate the signature.
  475. // If we did this for declare statements we get two repeated lines
  476. if (!decl.getKind().isDeclare()) {
  477. String sigs = generateSignatures(decl);
  478. entry += sigs + "<P>";
  479. }
  480. entry += generateAffects(decl) + generateDetailsComment(decl);
  481. }
  482. // insert the entry
  483. if (i != decls.size() - 1) {
  484. entry += "<P><HR>\n";
  485. } else {
  486. entry += "<P>";
  487. }
  488. fileBuffer.insert(insertIndex, entry);
  489. insertIndex += entry.length();
  490. }
  491. }
  492. }
  493. /**
  494. * TODO: don't place the summary first.
  495. */
  496. static int findSummaryIndex(StringBuffer fileBuffer, int index) {
  497. String fbs = fileBuffer.toString();
  498. String MARKER_1 = "<!-- =========== FIELD SUMMARY =========== -->";
  499. String MARKER_2 = "<!-- ======== CONSTRUCTOR SUMMARY ======== -->";
  500. int index1 = fbs.indexOf(MARKER_1, index);
  501. int index2 = fbs.indexOf(MARKER_2, index);
  502. if (index1 < index2 && index1 != -1) {
  503. return index1;
  504. } else if (index2 != -1) {
  505. return index2;
  506. } else {
  507. return index;
  508. }
  509. }
  510. static int findDetailsIndex(StringBuffer fileBuffer, int index) {
  511. String fbs = fileBuffer.toString();
  512. String MARKER_1 = "<!-- ========= CONSTRUCTOR DETAIL ======== -->";
  513. String MARKER_2 = "<!-- ============ FIELD DETAIL =========== -->";
  514. String MARKER_3 = "<!-- ============ METHOD DETAIL ========== -->";
  515. int index1 = fbs.indexOf(MARKER_1, index);
  516. int index2 = fbs.indexOf(MARKER_2, index);
  517. int index3 = fbs.indexOf(MARKER_3, index);
  518. if (index1 != -1 && index1 < index2 && index1 < index3) {
  519. return index1;
  520. } else if (index2 != -1 && index2 < index1 && index2 < index3) {
  521. return index2;
  522. } else if (index3 != -1) {
  523. return index3;
  524. } else {
  525. return index;
  526. }
  527. }
  528. static void decorateDocWithRel(IProgramElement node, StringBuffer fileContentsBuffer, int index, List targets,
  529. HtmlRelationshipKind relKind) {
  530. if (targets != null && !targets.isEmpty()) {
  531. String adviceDoc = "<TABLE WIDTH=\"100%\" BGCOLOR=#FFFFFF><TR>"
  532. + "<TD width=\"15%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>" + relKind.toString() + "</font></b></td><td>";
  533. String relativePackagePath = getRelativePathFromHere(node.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR);
  534. List addedNames = new ArrayList();
  535. for (Iterator it = targets.iterator(); it.hasNext();) {
  536. Object o = it.next();
  537. IProgramElement currDecl = null;
  538. if (o instanceof String) {
  539. String currHandle = (String) o;
  540. currDecl = node.getModel().getHierarchy().findElementForHandle(currHandle);
  541. } else if (o instanceof IProgramElement) {
  542. currDecl = (IProgramElement) o;
  543. } else {
  544. return;
  545. }
  546. String packagePath = "";
  547. if (currDecl.getPackageName() != null && !currDecl.getPackageName().equals("")) {
  548. packagePath = currDecl.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR;
  549. }
  550. String hrefName = "";
  551. String hrefLink = "";
  552. // Start the hRefLink with the relative path based on where
  553. // *this* type (i.e. the advised) is in the package structure.
  554. hrefLink = relativePackagePath + packagePath;
  555. if (currDecl.getPackageName() != null) {
  556. hrefName = currDecl.getPackageName().replace('.', '/');
  557. }
  558. // in the case of nested classes, in order for the links to work,
  559. // need to have the correct file name which is something of the
  560. // form parentClass.nestedAspect.html
  561. List names = new ArrayList();
  562. IProgramElement parent = currDecl;
  563. while (parent != null
  564. && parent.getParent() != null
  565. && (!parent.getParent().getKind().equals(IProgramElement.Kind.FILE_JAVA) && !parent.getParent().getKind()
  566. .equals(IProgramElement.Kind.FILE_ASPECTJ))) {
  567. parent = parent.getParent();
  568. names.add(parent.toLinkLabelString());
  569. }
  570. StringBuilder sbuff = new StringBuilder();
  571. for (int i = names.size() - 1; i >= 0; i--) {
  572. String element = (String) names.get(i);
  573. if (i == 0) {
  574. sbuff.append(element);
  575. } else {
  576. sbuff.append(element + ".");
  577. }
  578. }
  579. // use the currDecl.toLabelString rather than currDecl.getName()
  580. // because two distinct advice blocks can have the same
  581. // currDecl.getName() and wouldn't both appear in the ajdoc
  582. hrefName += Config.DIR_SEP_CHAR + sbuff.toString() + "." + currDecl.toLabelString();
  583. // need to replace " with quot; otherwise the links wont work
  584. // for 'matches declare' relationship
  585. StringBuilder sb = new StringBuilder(currDecl.toLabelString());
  586. int nextQuote = sb.toString().indexOf("\"");
  587. while (nextQuote != -1) {
  588. sb.deleteCharAt(nextQuote);
  589. sb.insert(nextQuote, "quot;");
  590. nextQuote = sb.toString().indexOf("\"");
  591. }
  592. hrefLink += sbuff.toString() + ".html" + "#" + sb.toString();
  593. if (!addedNames.contains(hrefName)) {
  594. adviceDoc = adviceDoc + "<A HREF=\"" + hrefLink + "\"><tt>" + hrefName.replace('/', '.') + "</tt></A>";
  595. if (it.hasNext())
  596. adviceDoc += ", ";
  597. addedNames.add(hrefName);
  598. }
  599. }
  600. adviceDoc += "</TR></TD></TABLE>\n";
  601. fileContentsBuffer.insert(index, adviceDoc);
  602. }
  603. }
  604. static void decorateMemberDocumentation(IProgramElement node, StringBuffer fileContentsBuffer, int index) {
  605. List<String> targets = StructureUtil.getTargets(node, IRelationship.Kind.ADVICE);
  606. decorateDocWithRel(node, fileContentsBuffer, index, targets, HtmlRelationshipKind.ADVISED_BY);
  607. List<String> warnings = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE, "matches declare");
  608. decorateDocWithRel(node, fileContentsBuffer, index, warnings, HtmlRelationshipKind.MATCHES_DECLARE);
  609. List<String> softenedBy = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE, "softened by");
  610. decorateDocWithRel(node, fileContentsBuffer, index, softenedBy, HtmlRelationshipKind.SOFTENED_BY);
  611. List<String> annotatedBy = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE_INTER_TYPE, "annotated by");
  612. decorateDocWithRel(node, fileContentsBuffer, index, annotatedBy, HtmlRelationshipKind.ANNOTATED_BY);
  613. }
  614. /**
  615. * pr119453 - adding "declared by" relationship
  616. */
  617. static String generateDeclaredBy(IProgramElement decl) {
  618. String entry = "<TABLE WIDTH=\"100%\" BGCOLOR=#FFFFFF><TR>"
  619. + "<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>" + "&nbsp;Declared&nbsp;by:</b></font></td><td>";
  620. String relativePackagePath = getRelativePathFromHere(decl.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR);
  621. if (decl != null && !StructureUtil.isAnonymous(decl.getParent())) {
  622. String packagePath = "";
  623. if (decl.getPackageName() != null && !decl.getPackageName().equals("")) {
  624. packagePath = decl.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR;
  625. }
  626. String typeSignature = constructNestedTypeName(decl);
  627. String hrefName = packagePath + typeSignature;
  628. // The hrefLink needs to just be the corresponding aspect
  629. String hrefLink = relativePackagePath + packagePath + typeSignature + ".html";
  630. entry += "<A HREF=\"" + hrefLink + "\"><tt>" + hrefName.replace('/', '.') + "</tt></A>"; // !!! don't replace
  631. }
  632. entry += "</B></FONT></TD></TR></TABLE>\n</TR></TD>\n";
  633. return entry;
  634. }
  635. /**
  636. * TODO: probably want to make this the same for intros and advice.
  637. */
  638. static String generateAffects(IProgramElement decl) {
  639. List targets = null;
  640. if (decl.getKind().isDeclare() || decl.getKind().isInterTypeMember()) {
  641. targets = StructureUtil.getDeclareTargets(decl);
  642. } else {
  643. targets = StructureUtil.getTargets(decl, IRelationship.Kind.ADVICE);
  644. }
  645. if (targets == null)
  646. return "";
  647. String entry = "<TABLE WIDTH=\"100%\" BGCOLOR=#FFFFFF><TR>";
  648. IProgramElement.Kind kind = decl.getKind();
  649. if (kind.equals(IProgramElement.Kind.ADVICE)) {
  650. entry += "<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>" + HtmlRelationshipKind.ADVISES.toString()
  651. + "</b></font></td><td>";
  652. } else if (kind.equals(IProgramElement.Kind.DECLARE_WARNING) || kind.equals(IProgramElement.Kind.DECLARE_ERROR)) {
  653. entry += "<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>" + HtmlRelationshipKind.MATCHED_BY.toString()
  654. + "</b></font></td><td>";
  655. } else if (kind.isDeclareAnnotation()) {
  656. entry += "<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>" + HtmlRelationshipKind.ANNOTATES.toString()
  657. + "</b></font></td><td>";
  658. } else if (kind.equals(IProgramElement.Kind.DECLARE_SOFT)) {
  659. entry += "<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>" + HtmlRelationshipKind.SOFTENS.toString()
  660. + "</b></font></td><td>";
  661. } else {
  662. entry += "<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>" + HtmlRelationshipKind.DECLARED_ON.toString()
  663. + "</b></font></td><td>";
  664. }
  665. String relativePackagePath = getRelativePathFromHere(decl.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR);
  666. List addedNames = new ArrayList(); // for ensuring that we don't add duplciates
  667. for (Iterator it = targets.iterator(); it.hasNext();) {
  668. String currHandle = (String) it.next();
  669. IProgramElement currDecl = decl.getModel().getHierarchy().findElementForHandle(currHandle);
  670. if (currDecl.getKind().equals(IProgramElement.Kind.CODE)) {
  671. currDecl = currDecl.getParent(); // promote to enclosing
  672. }
  673. if (currDecl != null && !StructureUtil.isAnonymous(currDecl.getParent())) {
  674. String packagePath = "";
  675. if (currDecl.getPackageName() != null && !currDecl.getPackageName().equals("")) {
  676. packagePath = currDecl.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR;
  677. }
  678. String typeSignature = constructNestedTypeName(currDecl);
  679. String hrefName = packagePath + typeSignature;
  680. // Start the hRefLink with the relative path based on where
  681. // *this* type (i.e. the advisor) is in the package structure.
  682. String hrefLink = relativePackagePath + packagePath + typeSignature + ".html";
  683. if (!currDecl.getKind().isType()) {
  684. hrefName += '.' + currDecl.getName();
  685. hrefLink += "#" + currDecl.toLabelString();
  686. }
  687. if (!addedNames.contains(hrefName)) {
  688. entry += "<A HREF=\"" + hrefLink + "\"><tt>" + hrefName.replace('/', '.') + "</tt></A>"; // !!! don't replace
  689. if (it.hasNext())
  690. entry += ", ";
  691. addedNames.add(hrefName);
  692. }
  693. }
  694. }
  695. entry += "</B></FONT></TD></TR></TABLE>\n</TR></TD>\n";
  696. return entry;
  697. }
  698. /**
  699. * Generates a relative directory path fragment that can be used to navigate "upwards" from the directory location implied by
  700. * the argument.
  701. *
  702. * @param packagePath
  703. * @return String consisting of multiple "../" parts, one for each component part of the input <code>packagePath</code>.
  704. */
  705. private static String getRelativePathFromHere(String packagePath) {
  706. StringBuilder result = new StringBuilder("");
  707. if (packagePath != null && (packagePath.contains("/"))) {
  708. StringTokenizer sTok = new StringTokenizer(packagePath, "/", false);
  709. while (sTok.hasMoreTokens()) {
  710. sTok.nextToken(); // don't care about the token value
  711. result.append(".." + Config.DIR_SEP_CHAR);
  712. }// end while
  713. }// end if
  714. return result.toString();
  715. }
  716. /**
  717. * Generate the "public int"-type information about the given IProgramElement. Used when dealing with ITDs. To mirror the
  718. * behaviour of methods and fields in classes, if we're generating the summary information we don't want to include "public" if
  719. * the accessibility of the IProgramElement is public.
  720. *
  721. */
  722. private static String generateModifierInformation(IProgramElement decl, boolean isDetails) {
  723. String intro = "";
  724. if (decl.getKind().isDeclare()) {
  725. return intro + "</TT>";
  726. }
  727. if (isDetails || !decl.getAccessibility().equals(IProgramElement.Accessibility.PUBLIC)) {
  728. intro += "<TT>" + decl.getAccessibility().toString() + "&nbsp;";
  729. }
  730. if (decl.getKind().equals(IProgramElement.Kind.INTER_TYPE_FIELD)) {
  731. return intro + decl.getCorrespondingType() + "</TT>";
  732. } else if (decl.getKind().equals(IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR) && isDetails) {
  733. return intro + "</TT>";
  734. } else {
  735. return intro + decl.getCorrespondingType(true) + "</TT>";
  736. }
  737. }
  738. static String generateIntroductionSignatures(IProgramElement decl, boolean isDetails) {
  739. return "<not implemented>";
  740. }
  741. static String generateSignatures(IProgramElement decl) {
  742. return "<B>" + decl.toLabelString() + "</B>";
  743. }
  744. static String generateSummaryComment(IProgramElement decl) {
  745. String COMMENT_INDENT = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; // !!!
  746. String formattedComment = getFormattedComment(decl);
  747. int periodIndex = formattedComment.indexOf('.');
  748. if (formattedComment.equals("")) {
  749. return "";
  750. } else if (periodIndex != -1) {
  751. return COMMENT_INDENT + formattedComment.substring(0, periodIndex + 1);
  752. } else {
  753. return COMMENT_INDENT + formattedComment;
  754. }
  755. }
  756. static String generateDetailsComment(IProgramElement decl) {
  757. return getFormattedComment(decl);
  758. }
  759. static String generateHREFName(IProgramElement decl) {
  760. StringBuilder hrefLinkBuffer = new StringBuilder();
  761. char[] declChars = decl.toLabelString().toCharArray();
  762. for (char declChar : declChars) {
  763. if (declChar == '"') {
  764. hrefLinkBuffer.append("quot;");
  765. } else {
  766. hrefLinkBuffer.append(declChar);
  767. }
  768. }
  769. return hrefLinkBuffer.toString();
  770. }
  771. /**
  772. * Figure out the link relative to the package.
  773. */
  774. static String generateAffectsHREFLink(String declaringType) {
  775. String link = rootDir.getAbsolutePath() + "/" + declaringType + ".html";
  776. return link;
  777. }
  778. /**
  779. * This formats a comment according to the rules in the Java Langauge Spec: <I>The text of a docuemntation comment consists of
  780. * the characters between the /** that begins the comment and the 'star-slash' that ends it. The text is devided into one or
  781. * more lines. On each of these lines, the leading * characters are ignored; for lines other than the first, blanks and tabs
  782. * preceding the initial * characters are also discarded.</I>
  783. *
  784. * TODO: implement formatting or linking for tags.
  785. */
  786. static String getFormattedComment(IProgramElement decl) {
  787. String comment = decl.getFormalComment();
  788. if (comment == null)
  789. return "";
  790. String formattedComment = "";
  791. // strip the comment markers
  792. int startIndex = comment.indexOf("/**");
  793. int endIndex = comment.indexOf("*/");
  794. if (startIndex == -1) {
  795. startIndex = 0;
  796. } else {
  797. startIndex += 3;
  798. }
  799. if (endIndex == -1) {
  800. endIndex = comment.length();
  801. }
  802. comment = comment.substring(startIndex, endIndex);
  803. // string the leading whitespace and '*' characters at the beginning of each line
  804. BufferedReader reader = new BufferedReader(new StringReader(comment));
  805. try {
  806. for (String line = reader.readLine(); line != null; line = reader.readLine()) {
  807. line = line.trim();
  808. for (int i = 0; i < line.length(); i++) {
  809. if (line.charAt(0) == '*') {
  810. line = line.substring(1, line.length());
  811. } else {
  812. break;
  813. }
  814. }
  815. // !!! remove any @see and @link tags from the line
  816. // int seeIndex = line.indexOf("@see");
  817. // int linkIndex = line.indexOf("@link");
  818. // if ( seeIndex != -1 ) {
  819. // line = line.substring(0, seeIndex) + line.substring(seeIndex);
  820. // }
  821. // if ( linkIndex != -1 ) {
  822. // line = line.substring(0, linkIndex) + line.substring(linkIndex);
  823. // }
  824. formattedComment += line;
  825. }
  826. } catch (IOException ioe) {
  827. throw new Error("Couldn't format comment for declaration: " + decl.getName());
  828. }
  829. return formattedComment;
  830. }
  831. static public IProgramElement[] getProgramElements(AsmManager model, String filename) {
  832. IProgramElement file = model.getHierarchy().findElementForSourceFile(filename);
  833. final List nodes = new ArrayList();
  834. HierarchyWalker walker = new HierarchyWalker() {
  835. public void preProcess(IProgramElement node) {
  836. IProgramElement p = node;
  837. if (accept(node))
  838. nodes.add(p);
  839. }
  840. };
  841. file.walk(walker);
  842. return (IProgramElement[]) nodes.toArray(new IProgramElement[0]);
  843. }
  844. /**
  845. * Rejects anonymous kinds by checking if their name is an integer
  846. */
  847. static private boolean accept(IProgramElement node) {
  848. if (node.getKind().isType()) {
  849. boolean isAnonymous = StructureUtil.isAnonymous(node);
  850. return !node.getParent().getKind().equals(IProgramElement.Kind.METHOD) && !isAnonymous;
  851. } else {
  852. return !node.getKind().equals(IProgramElement.Kind.IMPORT_REFERENCE);
  853. }
  854. }
  855. /**
  856. * TypeSafeEnum for the entries which need to be put in the html doc
  857. */
  858. public static class HtmlRelationshipKind extends TypeSafeEnum {
  859. public HtmlRelationshipKind(String name, int key) {
  860. super(name, key);
  861. }
  862. public static HtmlRelationshipKind read(DataInputStream s) throws IOException {
  863. int key = s.readByte();
  864. switch (key) {
  865. case 1:
  866. return ADVISES;
  867. case 2:
  868. return ADVISED_BY;
  869. case 3:
  870. return MATCHED_BY;
  871. case 4:
  872. return MATCHES_DECLARE;
  873. case 5:
  874. return DECLARED_ON;
  875. case 6:
  876. return ASPECT_DECLARATIONS;
  877. case 7:
  878. return SOFTENS;
  879. case 8:
  880. return SOFTENED_BY;
  881. case 9:
  882. return ANNOTATES;
  883. case 10:
  884. return ANNOTATED_BY;
  885. case 11:
  886. return USES_POINTCUT;
  887. case 12:
  888. return POINTCUT_USED_BY;
  889. }
  890. throw new Error("weird relationship kind " + key);
  891. }
  892. public static final HtmlRelationshipKind ADVISES = new HtmlRelationshipKind("&nbsp;Advises:", 1);
  893. public static final HtmlRelationshipKind ADVISED_BY = new HtmlRelationshipKind("&nbsp;Advised&nbsp;by:", 2);
  894. public static final HtmlRelationshipKind MATCHED_BY = new HtmlRelationshipKind("&nbsp;Matched&nbsp;by:", 3);
  895. public static final HtmlRelationshipKind MATCHES_DECLARE = new HtmlRelationshipKind("&nbsp;Matches&nbsp;declare:", 4);
  896. public static final HtmlRelationshipKind DECLARED_ON = new HtmlRelationshipKind("&nbsp;Declared&nbsp;on:", 5);
  897. public static final HtmlRelationshipKind ASPECT_DECLARATIONS = new HtmlRelationshipKind("&nbsp;Aspect&nbsp;declarations:",
  898. 6);
  899. public static final HtmlRelationshipKind SOFTENS = new HtmlRelationshipKind("&nbsp;Softens:", 7);
  900. public static final HtmlRelationshipKind SOFTENED_BY = new HtmlRelationshipKind("&nbsp;Softened&nbsp;by:", 8);
  901. public static final HtmlRelationshipKind ANNOTATES = new HtmlRelationshipKind("&nbsp;Annotates:", 9);
  902. public static final HtmlRelationshipKind ANNOTATED_BY = new HtmlRelationshipKind("&nbsp;Annotated&nbsp;by:", 10);
  903. public static final HtmlRelationshipKind USES_POINTCUT = new HtmlRelationshipKind("&nbsp;Uses&nbsp;pointcut:", 11);
  904. public static final HtmlRelationshipKind POINTCUT_USED_BY = new HtmlRelationshipKind("&nbsp;Pointcut&nbsp;used&nbsp;by:",
  905. 12);
  906. }
  907. }