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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  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.isVMGreaterOrEqual(16))
  41. TYPE_NAME_LABEL = "element-name type-name-label";
  42. else if (LangUtil.isVMGreaterOrEqual(15))
  43. TYPE_NAME_LABEL = "type-name-label";
  44. else if (LangUtil.isVMGreaterOrEqual(1.8))
  45. TYPE_NAME_LABEL = "typeNameLabel";
  46. else
  47. TYPE_NAME_LABEL = "strong";
  48. if (LangUtil.isVMGreaterOrEqual(16))
  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. StringBuilder fileContents = new StringBuilder();
  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, StringBuilder 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(StringBuilder 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(StringBuilder 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(StringBuilder 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(StringBuilder 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, StringBuilder fileContentsBuffer, int index, List targets,
  529. HtmlRelationshipKind relKind) {
  530. if (targets != null && !targets.isEmpty()) {
  531. StringBuilder adviceDoc = new StringBuilder("<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.append("<A HREF=\"").append(hrefLink).append("\"><tt>").append(hrefName.replace('/', '.')).append("</tt></A>");
  595. if (it.hasNext())
  596. adviceDoc.append(", ");
  597. addedNames.add(hrefName);
  598. }
  599. }
  600. adviceDoc.append("</TR></TD></TABLE>\n");
  601. fileContentsBuffer.insert(index, adviceDoc.toString());
  602. }
  603. }
  604. static void decorateMemberDocumentation(IProgramElement node, StringBuilder 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. StringBuilder entry = new StringBuilder("<TABLE WIDTH=\"100%\" BGCOLOR=#FFFFFF><TR>");
  648. IProgramElement.Kind kind = decl.getKind();
  649. if (kind.equals(IProgramElement.Kind.ADVICE)) {
  650. entry.append("<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>")
  651. .append(HtmlRelationshipKind.ADVISES)
  652. .append("</b></font></td><td>");
  653. } else if (kind.equals(IProgramElement.Kind.DECLARE_WARNING) || kind.equals(IProgramElement.Kind.DECLARE_ERROR)) {
  654. entry.append("<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>")
  655. .append(HtmlRelationshipKind.MATCHED_BY)
  656. .append("</b></font></td><td>");
  657. } else if (kind.isDeclareAnnotation()) {
  658. entry.append("<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>")
  659. .append(HtmlRelationshipKind.ANNOTATES)
  660. .append("</b></font></td><td>");
  661. } else if (kind.equals(IProgramElement.Kind.DECLARE_SOFT)) {
  662. entry.append("<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>")
  663. .append(HtmlRelationshipKind.SOFTENS)
  664. .append("</b></font></td><td>");
  665. } else {
  666. entry.append("<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>")
  667. .append(HtmlRelationshipKind.DECLARED_ON)
  668. .append("</b></font></td><td>");
  669. }
  670. String relativePackagePath = getRelativePathFromHere(decl.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR);
  671. List addedNames = new ArrayList(); // for ensuring that we don't add duplciates
  672. for (Iterator it = targets.iterator(); it.hasNext();) {
  673. String currHandle = (String) it.next();
  674. IProgramElement currDecl = decl.getModel().getHierarchy().findElementForHandle(currHandle);
  675. if (currDecl.getKind().equals(IProgramElement.Kind.CODE)) {
  676. currDecl = currDecl.getParent(); // promote to enclosing
  677. }
  678. if (currDecl != null && !StructureUtil.isAnonymous(currDecl.getParent())) {
  679. String packagePath = "";
  680. if (currDecl.getPackageName() != null && !currDecl.getPackageName().equals("")) {
  681. packagePath = currDecl.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR;
  682. }
  683. String typeSignature = constructNestedTypeName(currDecl);
  684. String hrefName = packagePath + typeSignature;
  685. // Start the hRefLink with the relative path based on where
  686. // *this* type (i.e. the advisor) is in the package structure.
  687. String hrefLink = relativePackagePath + packagePath + typeSignature + ".html";
  688. if (!currDecl.getKind().isType()) {
  689. hrefName += '.' + currDecl.getName();
  690. hrefLink += "#" + currDecl.toLabelString();
  691. }
  692. if (!addedNames.contains(hrefName)) {
  693. entry.append("<A HREF=\"").append(hrefLink).append("\"><tt>").append(hrefName.replace('/', '.')).append("</tt></A>"); // !!! don't replace
  694. if (it.hasNext())
  695. entry.append(", ");
  696. addedNames.add(hrefName);
  697. }
  698. }
  699. }
  700. entry.append("</B></FONT></TD></TR></TABLE>\n</TR></TD>\n");
  701. return entry.toString();
  702. }
  703. /**
  704. * Generates a relative directory path fragment that can be used to navigate "upwards" from the directory location implied by
  705. * the argument.
  706. *
  707. * @param packagePath
  708. * @return String consisting of multiple "../" parts, one for each component part of the input <code>packagePath</code>.
  709. */
  710. private static String getRelativePathFromHere(String packagePath) {
  711. StringBuilder result = new StringBuilder("");
  712. if (packagePath != null && (packagePath.contains("/"))) {
  713. StringTokenizer sTok = new StringTokenizer(packagePath, "/", false);
  714. while (sTok.hasMoreTokens()) {
  715. sTok.nextToken(); // don't care about the token value
  716. result.append(".." + Config.DIR_SEP_CHAR);
  717. }// end while
  718. }// end if
  719. return result.toString();
  720. }
  721. /**
  722. * Generate the "public int"-type information about the given IProgramElement. Used when dealing with ITDs. To mirror the
  723. * behaviour of methods and fields in classes, if we're generating the summary information we don't want to include "public" if
  724. * the accessibility of the IProgramElement is public.
  725. *
  726. */
  727. private static String generateModifierInformation(IProgramElement decl, boolean isDetails) {
  728. String intro = "";
  729. if (decl.getKind().isDeclare()) {
  730. return intro + "</TT>";
  731. }
  732. if (isDetails || !decl.getAccessibility().equals(IProgramElement.Accessibility.PUBLIC)) {
  733. intro += "<TT>" + decl.getAccessibility().toString() + "&nbsp;";
  734. }
  735. if (decl.getKind().equals(IProgramElement.Kind.INTER_TYPE_FIELD)) {
  736. return intro + decl.getCorrespondingType() + "</TT>";
  737. } else if (decl.getKind().equals(IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR) && isDetails) {
  738. return intro + "</TT>";
  739. } else {
  740. return intro + decl.getCorrespondingType(true) + "</TT>";
  741. }
  742. }
  743. static String generateIntroductionSignatures(IProgramElement decl, boolean isDetails) {
  744. return "<not implemented>";
  745. }
  746. static String generateSignatures(IProgramElement decl) {
  747. return "<B>" + decl.toLabelString() + "</B>";
  748. }
  749. static String generateSummaryComment(IProgramElement decl) {
  750. String COMMENT_INDENT = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; // !!!
  751. String formattedComment = getFormattedComment(decl);
  752. int periodIndex = formattedComment.indexOf('.');
  753. if (formattedComment.equals("")) {
  754. return "";
  755. } else if (periodIndex != -1) {
  756. return COMMENT_INDENT + formattedComment.substring(0, periodIndex + 1);
  757. } else {
  758. return COMMENT_INDENT + formattedComment;
  759. }
  760. }
  761. static String generateDetailsComment(IProgramElement decl) {
  762. return getFormattedComment(decl);
  763. }
  764. static String generateHREFName(IProgramElement decl) {
  765. StringBuilder hrefLinkBuffer = new StringBuilder();
  766. char[] declChars = decl.toLabelString().toCharArray();
  767. for (char declChar : declChars) {
  768. if (declChar == '"') {
  769. hrefLinkBuffer.append("quot;");
  770. } else {
  771. hrefLinkBuffer.append(declChar);
  772. }
  773. }
  774. return hrefLinkBuffer.toString();
  775. }
  776. /**
  777. * Figure out the link relative to the package.
  778. */
  779. static String generateAffectsHREFLink(String declaringType) {
  780. String link = rootDir.getAbsolutePath() + "/" + declaringType + ".html";
  781. return link;
  782. }
  783. /**
  784. * This formats a comment according to the rules in the Java Langauge Spec: <I>The text of a docuemntation comment consists of
  785. * the characters between the /** that begins the comment and the 'star-slash' that ends it. The text is devided into one or
  786. * more lines. On each of these lines, the leading * characters are ignored; for lines other than the first, blanks and tabs
  787. * preceding the initial * characters are also discarded.</I>
  788. *
  789. * TODO: implement formatting or linking for tags.
  790. */
  791. static String getFormattedComment(IProgramElement decl) {
  792. String comment = decl.getFormalComment();
  793. if (comment == null)
  794. return "";
  795. StringBuilder formattedComment = new StringBuilder();
  796. // strip the comment markers
  797. int startIndex = comment.indexOf("/**");
  798. int endIndex = comment.indexOf("*/");
  799. if (startIndex == -1) {
  800. startIndex = 0;
  801. } else {
  802. startIndex += 3;
  803. }
  804. if (endIndex == -1) {
  805. endIndex = comment.length();
  806. }
  807. comment = comment.substring(startIndex, endIndex);
  808. // string the leading whitespace and '*' characters at the beginning of each line
  809. BufferedReader reader = new BufferedReader(new StringReader(comment));
  810. try {
  811. for (String line = reader.readLine(); line != null; line = reader.readLine()) {
  812. line = line.trim();
  813. for (int i = 0; i < line.length(); i++) {
  814. if (line.charAt(0) == '*') {
  815. line = line.substring(1, line.length());
  816. } else {
  817. break;
  818. }
  819. }
  820. // !!! remove any @see and @link tags from the line
  821. // int seeIndex = line.indexOf("@see");
  822. // int linkIndex = line.indexOf("@link");
  823. // if ( seeIndex != -1 ) {
  824. // line = line.substring(0, seeIndex) + line.substring(seeIndex);
  825. // }
  826. // if ( linkIndex != -1 ) {
  827. // line = line.substring(0, linkIndex) + line.substring(linkIndex);
  828. // }
  829. formattedComment.append(line);
  830. }
  831. } catch (IOException ioe) {
  832. throw new Error("Couldn't format comment for declaration: " + decl.getName());
  833. }
  834. return formattedComment.toString();
  835. }
  836. static public IProgramElement[] getProgramElements(AsmManager model, String filename) {
  837. IProgramElement file = model.getHierarchy().findElementForSourceFile(filename);
  838. final List nodes = new ArrayList();
  839. HierarchyWalker walker = new HierarchyWalker() {
  840. public void preProcess(IProgramElement node) {
  841. IProgramElement p = node;
  842. if (accept(node))
  843. nodes.add(p);
  844. }
  845. };
  846. file.walk(walker);
  847. return (IProgramElement[]) nodes.toArray(new IProgramElement[0]);
  848. }
  849. /**
  850. * Rejects anonymous kinds by checking if their name is an integer
  851. */
  852. static private boolean accept(IProgramElement node) {
  853. if (node.getKind().isType()) {
  854. boolean isAnonymous = StructureUtil.isAnonymous(node);
  855. return !node.getParent().getKind().equals(IProgramElement.Kind.METHOD) && !isAnonymous;
  856. } else {
  857. return !node.getKind().equals(IProgramElement.Kind.IMPORT_REFERENCE);
  858. }
  859. }
  860. /**
  861. * TypeSafeEnum for the entries which need to be put in the html doc
  862. */
  863. public static class HtmlRelationshipKind extends TypeSafeEnum {
  864. public HtmlRelationshipKind(String name, int key) {
  865. super(name, key);
  866. }
  867. public static HtmlRelationshipKind read(DataInputStream s) throws IOException {
  868. int key = s.readByte();
  869. switch (key) {
  870. case 1:
  871. return ADVISES;
  872. case 2:
  873. return ADVISED_BY;
  874. case 3:
  875. return MATCHED_BY;
  876. case 4:
  877. return MATCHES_DECLARE;
  878. case 5:
  879. return DECLARED_ON;
  880. case 6:
  881. return ASPECT_DECLARATIONS;
  882. case 7:
  883. return SOFTENS;
  884. case 8:
  885. return SOFTENED_BY;
  886. case 9:
  887. return ANNOTATES;
  888. case 10:
  889. return ANNOTATED_BY;
  890. case 11:
  891. return USES_POINTCUT;
  892. case 12:
  893. return POINTCUT_USED_BY;
  894. }
  895. throw new Error("weird relationship kind " + key);
  896. }
  897. public static final HtmlRelationshipKind ADVISES = new HtmlRelationshipKind("&nbsp;Advises:", 1);
  898. public static final HtmlRelationshipKind ADVISED_BY = new HtmlRelationshipKind("&nbsp;Advised&nbsp;by:", 2);
  899. public static final HtmlRelationshipKind MATCHED_BY = new HtmlRelationshipKind("&nbsp;Matched&nbsp;by:", 3);
  900. public static final HtmlRelationshipKind MATCHES_DECLARE = new HtmlRelationshipKind("&nbsp;Matches&nbsp;declare:", 4);
  901. public static final HtmlRelationshipKind DECLARED_ON = new HtmlRelationshipKind("&nbsp;Declared&nbsp;on:", 5);
  902. public static final HtmlRelationshipKind ASPECT_DECLARATIONS = new HtmlRelationshipKind("&nbsp;Aspect&nbsp;declarations:",
  903. 6);
  904. public static final HtmlRelationshipKind SOFTENS = new HtmlRelationshipKind("&nbsp;Softens:", 7);
  905. public static final HtmlRelationshipKind SOFTENED_BY = new HtmlRelationshipKind("&nbsp;Softened&nbsp;by:", 8);
  906. public static final HtmlRelationshipKind ANNOTATES = new HtmlRelationshipKind("&nbsp;Annotates:", 9);
  907. public static final HtmlRelationshipKind ANNOTATED_BY = new HtmlRelationshipKind("&nbsp;Annotated&nbsp;by:", 10);
  908. public static final HtmlRelationshipKind USES_POINTCUT = new HtmlRelationshipKind("&nbsp;Uses&nbsp;pointcut:", 11);
  909. public static final HtmlRelationshipKind POINTCUT_USED_BY = new HtmlRelationshipKind("&nbsp;Pointcut&nbsp;used&nbsp;by:",
  910. 12);
  911. }
  912. }