You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by di...@apache.org on 2003/10/19 15:47:41 UTC
cvs commit: maven/src/plugins-build/jxr/src/main/org/apache/maven/jxr CodeTransform.java
dion 2003/10/19 06:47:41
Modified: src/plugins-build/jxr/src/plugin-resources stylesheet.css
src/plugins-build/jxr/src/plugin-resources/templates
allclasses-frame.jelly package-summary.jelly
package-frame.jelly overview-frame.jelly
overview-summary.jelly index.jelly
src/plugins-build/jxr/xdocs changes.xml
src/plugins-build/jxr/src/main/org/apache/maven/jxr
CodeTransform.java
Log:
Apply MAVEN-797
Revision Changes Path
1.2 +91 -40 maven/src/plugins-build/jxr/src/plugin-resources/stylesheet.css
Index: stylesheet.css
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/jxr/src/plugin-resources/stylesheet.css,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- stylesheet.css 24 Jan 2003 03:45:44 -0000 1.1
+++ stylesheet.css 19 Oct 2003 13:47:41 -0000 1.2
@@ -1,45 +1,96 @@
/* Javadoc style sheet */
-
/* Define colors, fonts and other style attributes here to override the defaults */
+body {
+ background-color: #fff;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+a:link {
+ color: #00f;
+}
+a:visited {
+ color: #00a;
+}
-/* Page background color */
-body { background-color: #FFFFFF }
-
-a:link, a:visited {
- color: blue;
- }
-
-a:active, a:hover, #leftcol a:active, #leftcol a:hover {
+a:active, a:hover {
color: #f30 !important;
- }
-
-a:link.selfref, a:visited.selfref {
- color: #555 !important;
- }
-
-.a td {
- background: #ddd;
- color: #000;
- }
-
-/* Table colors */
-.TableHeadingColor { background: #036; color:#FFFFFF } /* Dark blue */
-.TableSubHeadingColor { background: #bbb; color:#fff } /* Dark grey */
-.TableRowColor { background: #efefef } /* White */
-
-/* Font used in left-hand frame lists */
-.FrameTitleFont { font-size: normal; font-family: normal; color:#000000 }
-.FrameHeadingFont { font-size: normal; font-family: normal; color:#000000 }
-.FrameItemFont { font-size: normal; font-family: normal; color:#000000 }
-
-/* Example of smaller, sans-serif font in frames */
-/* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */
-
-/* Navigation bar fonts and colors */
-.NavBarCell1 { background-color:#ddd;}/* Light mauve */
-.NavBarCell1Rev { background-color:#888;}/* Dark Blue */
-.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;}
-.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}
+}
-.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
-.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
+ul, li {
+ list-style-type:none ;
+ margin:0;
+ padding:0;
+}
+
+table td{
+ padding: 3px;
+ border: 1px solid #000;
+}
+table{
+ width:100%;
+ border: 1px solid #000;
+ border-collapse: collapse;
+}
+
+div.overview {
+ background-color:#ddd;
+ padding: 4px 4px 4px 0;
+}
+div.overview li, div.framenoframe li {
+ display: inline;
+}
+div.framenoframe {
+ text-align: center;
+ font-size: x-small;
+}
+div.framenoframe li {
+ margin: 0 3px 0 3px;
+}
+div.overview li {
+ margin:3px 3px 0 3px;
+ padding: 4px;
+}
+li.selected {
+ background-color:#888;
+ color: #fff;
+ font-weight: bold;
+}
+
+table.summary {
+ margin-bottom: 20px;
+}
+table.summary td, table.summary th {
+ font-weight: bold;
+ text-align: left;
+ padding: 3px;
+}
+table.summary th{
+ background-color:#036;
+ color: #fff;
+}
+table.summary td{
+ background-color:#eee;
+ border: 1px solid black;
+}
+
+em {
+ color: #A00;
+}
+em.comment {
+ color: #390;
+}
+.string {
+ color: #009;
+}
+div#footer {
+ text-align:center;
+}
+#overview {
+ padding:2px;
+}
+
+
+hr {
+ height: 1px;
+ color: #000;
+}
\ No newline at end of file
1.2 +14 -22 maven/src/plugins-build/jxr/src/plugin-resources/templates/allclasses-frame.jelly
Index: allclasses-frame.jelly
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/jxr/src/plugin-resources/templates/allclasses-frame.jelly,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- allclasses-frame.jelly 24 Jan 2003 03:45:44 -0000 1.1
+++ allclasses-frame.jelly 19 Oct 2003 13:47:41 -0000 1.2
@@ -1,33 +1,25 @@
<?xml version="1.0"?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:jsl="jelly:jsl">
- <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="DTD/xhtml1-transitional.dtd"/>
- <html>
+ <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="DTD/xhtml1-transitional.dtd" />
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <title>
- All Classes
- </title>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+ <title>All Classes</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="style" />
</head>
<body>
- <font class="FrameHeadingFont" size="+1">
- <b>All Classes</b>
- </font>
-
- <table border="0" width="100%">
- <tr>
- <font class="FrameItemFont">
- <td nowrap="nowrap">
- <j:forEach var="classInfo" items="${info.allClasses.values()}">
- <a href="${classInfo.dir}/${classInfo.name}.html" target="classFrame">${classInfo.name}</a>
- <br/>
- </j:forEach>
- </td>
- </font>
- </tr>
- </table>
+ <h3>All Classes</h3>
+
+ <ul>
+ <j:forEach var="classInfo" items="${info.allClasses.values()}">
+ <li>
+ <a href="${classInfo.dir}/${classInfo.name}.html" target="classFrame">${classInfo.name}</a>
+ </li>
+ </j:forEach>
+ </ul>
+
</body>
</html>
</j:jelly>
-
\ No newline at end of file
1.2 +48 -64 maven/src/plugins-build/jxr/src/plugin-resources/templates/package-summary.jelly
Index: package-summary.jelly
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/jxr/src/plugin-resources/templates/package-summary.jelly,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- package-summary.jelly 24 Jan 2003 03:45:44 -0000 1.1
+++ package-summary.jelly 19 Oct 2003 13:47:41 -0000 1.2
@@ -3,96 +3,80 @@
<x:parse var="doc">
<package-summary>
- <navbar/>
- <packages/>
- <navbar/>
+ <navbar />
+ <packages />
+ <navbar />
</package-summary>
</x:parse>
<jsl:stylesheet select="$doc">
<jsl:template match="package-summary">
- <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="DTD/xhtml1-transitional.dtd"/>
- <html>
+ <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="DTD/xhtml1-transitional.dtd" />
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <title>
- ${windowTitle} Package ${name}
- </title>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+ <title>${windowTitle} Package ${name}</title>
<link rel="stylesheet" type="text/css" href="${pkgInfo.rootRef}stylesheet.css" title="style" />
</head>
<body>
- <jsl:applyTemplates/>
-
- <hr/>
+ <jsl:applyTemplates />
- ${bottom}
+ <hr />
+ ${bottom}
</body>
</html>
</jsl:template>
<jsl:template match="packages">
<h2>Package ${pkgInfo.name}</h2>
-
- <table border="1" cellpadding="3" cellspacing="0" width="100%">
- <tr class="TableHeadingColor">
- <td>
- <font size="+2"><b>Class Summary</b></font>
- </td>
- </tr>
-
- <j:forEach var="classInfo" items="${pkgInfo.classes.values()}">
- <tr class="TableRowColor">
- <td>
- <b><a href="${classInfo.name}.html" target="classFrame">${classInfo.name}</a></b>
- </td>
+
+ <table class="summary">
+ <thead>
+ <tr>
+ <th>Class Summary</th>
</tr>
- </j:forEach>
+ </thead>
+
+ <tbody>
+ <j:forEach var="classInfo" items="${pkgInfo.classes.values()}">
+ <tr>
+ <td>
+ <a href="${classInfo.name}.html" target="classFrame">${classInfo.name}</a>
+ </td>
+ </tr>
+ </j:forEach>
+ </tbody>
</table>
- <p/>
- <hr/>
</jsl:template>
<jsl:template match="navbar">
<!-- ========== start of navbar ========== -->
- <a name="navbar_top"><!-- --></a>
- <table border="0" width="100%" cellpadding="1" cellspacing="0">
- <tr>
- <td colspan="2" class="NavBarCell1">
- <a name="navbar_top_firstrow"><!-- --></a>
- <table border="0" cellpadding="0" cellspacing="3">
- <tr align="center" valign="top">
- <td class="NavBarCell1">
- <a href="${pkgInfo.rootRef}overview-summary.html">
- &nbsp;<font class="NavBarFont1"><b>Overview</b></font>&nbsp;
- </a>
- </td>
-
- <td class="NavBarCell1Rev">
- <font class="NavBarFont1Rev">Package</font>
- </td>
- </tr>
- </table>
- </td>
- <td align="right" valign="top" rowspan="3">
- <em>
- </em>
- </td>
- </tr>
-
- <tr>
- <td class="NavBarCell2" colspan="2" align="center">
- <font size="-2">
- <a href="${pkgInfo.rootRef}index.html" target="_top"><b>FRAMES</b></a>
- &nbsp;
- <a href="package-summary.html" target="_top"><b>NO FRAMES</b></a>
- </font>
- </td>
- </tr>
- </table>
+
+ <div class="overview">
+ <ul>
+ <li>
+ <a href="${pkgInfo.rootRef}overview-summary.html">Overview</a>
+ </li>
+ <li class="selected">Package</li>
+ </ul>
+ </div>
+ <div class="framenoframe">
+ <ul>
+ <li>
+ <a href="${pkgInfo.rootRef}index.html" target="_top">FRAMES</a>
+ </li>
+ <li>
+ <a href="package-summary.html" target="_top">NO FRAMES</a>
+ </li>
+ </ul>
+ </div>
+
<!-- =========== end of navbar =========== -->
+
</jsl:template>
-
+
</jsl:stylesheet>
</j:jelly>
1.2 +15 -22 maven/src/plugins-build/jxr/src/plugin-resources/templates/package-frame.jelly
Index: package-frame.jelly
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/jxr/src/plugin-resources/templates/package-frame.jelly,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- package-frame.jelly 24 Jan 2003 03:45:44 -0000 1.1
+++ package-frame.jelly 19 Oct 2003 13:47:41 -0000 1.2
@@ -1,36 +1,29 @@
<?xml version="1.0"?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:jsl="jelly:jsl">
- <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="DTD/xhtml1-transitional.dtd"/>
- <html>
+ <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="DTD/xhtml1-transitional.dtd" />
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <title>
- ${windowTitle} Package ${pkgInfo.name}
- </title>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+ <title>${windowTitle} Package ${pkgInfo.name}</title>
<link rel="stylesheet" type="text/css" href="${pkgInfo.rootRef}stylesheet.css" title="style" />
</head>
<body>
- <font class="FrameTitleFont">
+ <h3>
<a href="package-summary.html" target="classFrame">${pkgInfo.name}</a>
- </font>
-
- <table border="0" width="100%">
- <tr>
- <td nowrap="nowrap">
- <font class="FrameHeadingFont">Classes</font>
- <br/>
+ </h3>
- <j:forEach var="classInfo" items="${pkgInfo.classes.values()}">
- <font class="FrameItemFont">
- <a href="${classInfo.name}.html" target="classFrame">${classInfo.name}</a>
- </font>
- <br/>
- </j:forEach>
+ <h3>Classes</h3>
+
+ <ul>
+ <j:forEach var="classInfo" items="${pkgInfo.classes.values()}">
+ <li>
+ <a href="${classInfo.name}.html" target="classFrame">${classInfo.name}</a>
+ </li>
+ </j:forEach>
+ </ul>
- </td>
- </tr>
- </table>
</body>
</html>
</j:jelly>
1.2 +15 -24 maven/src/plugins-build/jxr/src/plugin-resources/templates/overview-frame.jelly
Index: overview-frame.jelly
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/jxr/src/plugin-resources/templates/overview-frame.jelly,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- overview-frame.jelly 24 Jan 2003 03:45:44 -0000 1.1
+++ overview-frame.jelly 19 Oct 2003 13:47:41 -0000 1.2
@@ -1,38 +1,29 @@
<?xml version="1.0"?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:jsl="jelly:jsl">
- <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="DTD/xhtml1-transitional.dtd"/>
- <html>
+ <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="DTD/xhtml1-transitional.dtd" />
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <title>
- ${windowTitle}
- </title>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+ <title>${windowTitle}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="style" />
</head>
<body>
- <table border="0" width="100%">
- <tr>
- <td nowrap="nowrap">
- <font class="FrameItemFont">
- <a href="allclasses-frame.html" target="packageFrame">All Classes</a>
- </font>
- <p></p>
- <font class="FrameHeadingFont" size="+1">Packages</font>
- <br/>
+ <h3>
+ <a href="allclasses-frame.html" target="packageFrame">All Classes</a>
+ </h3>
- <j:forEach var="pkgInfo" items="${info.allPackages.values()}">
- <font class="FrameItemFont">
- <a href="${pkgInfo.dir}/package-frame.html" target="packageFrame">${pkgInfo.name}</a>
- </font>
- <br/>
- </j:forEach>
+ <h3>Packages</h3>
- </td>
- </tr>
- </table>
+ <ul>
+ <j:forEach var="pkgInfo" items="${info.allPackages.values()}">
+ <li>
+ <a href="${pkgInfo.dir}/package-frame.html" target="packageFrame">${pkgInfo.name}</a>
+ </li>
+ </j:forEach>
+ </ul>
- <p></p>
</body>
</html>
</j:jelly>
1.2 +44 -72 maven/src/plugins-build/jxr/src/plugin-resources/templates/overview-summary.jelly
Index: overview-summary.jelly
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/jxr/src/plugin-resources/templates/overview-summary.jelly,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- overview-summary.jelly 24 Jan 2003 03:45:44 -0000 1.1
+++ overview-summary.jelly 19 Oct 2003 13:47:41 -0000 1.2
@@ -3,102 +3,74 @@
<x:parse var="doc">
<overview>
- <navbar/>
- <packages/>
- <navbar/>
+ <navbar />
+ <packages />
+ <navbar />
</overview>
</x:parse>
<jsl:stylesheet select="$doc">
<jsl:template match="overview">
- <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="DTD/xhtml1-transitional.dtd"/>
- <html>
+ <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="DTD/xhtml1-transitional.dtd" />
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <title>
- ${windowTitle}
- </title>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+ <title>${windowTitle}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="style" />
</head>
<body>
- <jsl:applyTemplates/>
-
- <hr/>
-
+ <jsl:applyTemplates />
+ <hr />
${bottom}
-
</body>
</html>
</jsl:template>
-
<jsl:template match="packages">
- <hr/>
- <center>
- <h2>${docTitle}</h2>
- </center>
-
- <table border="1" cellpadding="3" cellspacing="0" width="100%">
- <tr class="TableHeadingColor">
- <td>
- <font size="+2">
- <b>Packages</b>
- </font>
- </td>
- </tr>
-
- <j:forEach var="pkgInfo" items="${info.allPackages.values()}">
- <tr class="TableRowColor">
- <td>
- <a href="${pkgInfo.dir}/package-summary.html">
- <b>${pkgInfo.name}</b>
- </a>
- </td>
+
+ <h2>${docTitle}</h2>
+
+ <table class="summary">
+ <thead>
+ <tr>
+ <th>Packages</th>
</tr>
- </j:forEach>
+ </thead>
+ <tbody>
+ <j:forEach var="pkgInfo" items="${info.allPackages.values()}">
+ <tr>
+ <td>
+ <a href="${pkgInfo.dir}/package-summary.html">${pkgInfo.name}</a>
+ </td>
+ </tr>
+ </j:forEach>
+ </tbody>
</table>
- <p/>
- <hr/>
</jsl:template>
-
<jsl:template match="navbar">
<!-- ========== start of navbar ========== -->
- <a name="navbar_top"><!-- --></a>
- <table border="0" width="100%" cellpadding="1" cellspacing="0">
- <tr>
- <td colspan="2" class="NavBarCell1">
- <a name="navbar_top_firstrow"><!-- --></a>
- <table border="0" cellpadding="0" cellspacing="3">
- <tr align="center" valign="top">
- <td class="NavBarCell1Rev">
- &nbsp;<font class="NavBarFont1Rev"><b>Overview</b></font>&nbsp;
- </td>
-
- <td class="NavBarCell1">
- <font class="NavBarFont1">Package</font>
- </td>
- </tr>
- </table>
- </td>
- <td align="right" valign="top" rowspan="3">
- <em>
- </em>
- </td>
- </tr>
-
- <tr>
- <td class="NavBarCell2" colspan="2" align="center">
- <font size="-2">
- <a href="index.html" target="_top"><b>FRAMES</b></a>
- &nbsp;
- <a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
- </font>
- </td>
- </tr>
- </table>
+
+ <div class="overview">
+ <ul>
+ <li class="selected">Overview</li>
+ <li>Package</li>
+ </ul>
+ </div>
+ <div class="framenoframe">
+ <ul>
+ <li>
+ <a href="index.html" target="_top">FRAMES</a>
+ </li>
+ <li>
+ <a href="overview-summary.html" target="_top">NO FRAMES</a>
+ </li>
+ </ul>
+ </div>
+
<!-- =========== end of navbar =========== -->
</jsl:template>
</jsl:stylesheet>
1.2 +12 -7 maven/src/plugins-build/jxr/src/plugin-resources/templates/index.jelly
Index: index.jelly
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/jxr/src/plugin-resources/templates/index.jelly,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- index.jelly 24 Jan 2003 03:45:44 -0000 1.1
+++ index.jelly 19 Oct 2003 13:47:41 -0000 1.2
@@ -1,19 +1,24 @@
<?xml version="1.0"?>
-<j:jelly trim="false" xmlns:j="jelly:core">
- <html>
+<j:jelly trim="false" xmlns:j="jelly:core" xmlns:x="jelly:xml">
+ <x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Frameset//EN" systemId="DTD/xhtml1-frameset.dtd" />
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<title>${windowTitle}</title>
</head>
<frameset cols="20%,80%">
<frameset rows="30%,70%">
- <frame src="overview-frame.html" name="packageListFrame"/>
- <frame src="allclasses-frame.html" name="packageFrame"/>
+ <frame src="overview-frame.html" name="packageListFrame" />
+ <frame src="allclasses-frame.html" name="packageFrame" />
</frameset>
- <frame src="overview-summary.html" name="classFrame"/>
+ <frame src="overview-summary.html" name="classFrame" />
</frameset>
<noframes>
- <h2>Frame Alert</h2>
- <p>You don't have frames. Go <a href="overview-summary.html">here</a></p>
+ <h1>Frame Alert</h1>
+ <p>
+ You don't have frames. Go
+ <a href="overview-summary.html">here</a>
+ </p>
</noframes>
</html>
</j:jelly>
1.11 +1 -0 maven/src/plugins-build/jxr/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/jxr/xdocs/changes.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- changes.xml 2 Oct 2003 00:18:52 -0000 1.10
+++ changes.xml 19 Oct 2003 13:47:41 -0000 1.11
@@ -10,6 +10,7 @@
<release version="1.3" date="in CVS">
<action dev="dion" type="fix">MAVEN-822</action>
+ <action dev="dion" type="fix">MAVEN-797</action>
</release>
<release version="1.2" date="2003-09-29">
1.8 +300 -232 maven/src/plugins-build/jxr/src/main/org/apache/maven/jxr/CodeTransform.java
Index: CodeTransform.java
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/jxr/src/main/org/apache/maven/jxr/CodeTransform.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CodeTransform.java 20 Aug 2003 11:17:31 -0000 1.7
+++ CodeTransform.java 19 Oct 2003 13:47:41 -0000 1.8
@@ -30,19 +30,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.PrintWriter;
+import java.io.Serializable;
import java.util.Hashtable;
import java.util.Vector;
import org.apache.commons.lang.StringUtils;
-
import org.apache.maven.jxr.pacman.ClassType;
-import org.apache.maven.jxr.pacman.PackageManager;
-import org.apache.maven.jxr.pacman.JavaFile;
-import org.apache.maven.jxr.pacman.ImportType;
import org.apache.maven.jxr.pacman.FileManager;
+import org.apache.maven.jxr.pacman.ImportType;
+import org.apache.maven.jxr.pacman.JavaFile;
+import org.apache.maven.jxr.pacman.PackageManager;
import org.apache.maven.jxr.pacman.PackageType;
-
import org.apache.maven.jxr.util.SimpleWordTokenizer;
import org.apache.maven.jxr.util.StringEntry;
@@ -59,84 +65,97 @@
* |__
* multiLineCommentFilter -> uriFilter
* |___
- * inlineCommentFilter
- * |___
- * stringFilter
- * |__
- * keywordFilter
- * |__
- * uriFilter
- * |__
- * jxrFilter
- * |__
- * importFilter
+ * inlineCommentFilter
+ * |___
+ * stringFilter
+ * |___
+ * keywordFilter
+ * |___
+ * uriFilter
+ * |___
+ * jxrFilter
+ * |___
+ * importFilter
* </pre>
*/
public class CodeTransform implements Serializable
{
+
/**
- * Description of the Field
+ * show line numbers
*/
- public final static boolean LINE_NUMBERS = true;
+ public static final boolean LINE_NUMBERS = true;
/**
- * Description of the Field
+ * start comment delimeter
*/
- public final static String BACKGROUND_COLOR = "#ffffff";
+ public static final String COMMENT_START = "<em class=\"comment\">";
/**
- * Description of the Field
+ * end comment delimeter
*/
- public final static String COMMENT_START = "<font color=\"#329900\"><i>";
+ public static final String COMMENT_END = "</em>";
/**
- * Description of the Field
+ * start javadoc comment delimeter
*/
- public final static String COMMENT_END = "</i></font>";
+ public static final String JAVADOC_COMMENT_START = "<em>";
/**
- * Description of the Field
+ * end javadoc comment delimeter
*/
- public final static String JAVADOC_COMMENT_START = "<font color=\"#AA0000\"><i>";
+ public static final String JAVADOC_COMMENT_END = "</em>";
/**
- * Description of the Field
+ * start String delimeter
*/
- public final static String JAVADOC_COMMENT_END = "</i></font>";
+ public static final String STRING_START = "<span class=\"string\">";
/**
- * Description of the Field
+ * end String delimeter
*/
- public final static String STRING_START = "<font color=\"#000099\">";
+ public static final String STRING_END = "</span>";
/**
- * Description of the Field
+ * start reserved word delimeter
*/
- public final static String STRING_END = "</font>";
+ public static final String RESERVED_WORD_START = "<strong>";
/**
- * Description of the Field
+ * end reserved word delimeter
*/
- public final static String RESERVED_WORD_START = "<b>";
+ public static final String RESERVED_WORD_END = "</strong>";
/**
- * Description of the Field
+ * stylesheet file name
*/
- public final static String RESERVED_WORD_END = "</b>";
+ public static final String STYLESHEET_FILENAME = "stylesheet.css";
/**
* Description of the Field
*/
- public final static String[] VALID_URI_SCHEMES = {"http://", "mailto:"};
+ public static final String[] VALID_URI_SCHEMES = {"http://", "mailto:"};
/**
* Specify the only characters that are allowed in a URI besides alpha and
* numeric characters. Refer RFC2396 - http://www.ietf.org/rfc/rfc2396.txt
*/
- public final static char[] VALID_URI_CHARS = {'?', '+', '%', '&', ':', '/', '.', '@', '_', ';', '=', '$', ',', '-', '!', '~', '*', '\'', '(', ')'};
-
+ public static final char[] VALID_URI_CHARS =
+ { '?', '+', '%', '&', ':', '/', '.', '@', '_', ';', '=', '$', ',', '-', '!', '~', '*', '\'', '(', ')' };
+
+ /**
+ * HashTable containing java reserved words
+ */
private Hashtable reservedWords = new Hashtable();
+
+ /**
+ * flag set to true when a multi line comment is started
+ */
private boolean inMultiLineComment = false;
+
+ /**
+ * flag set to true when a javadoc comment is started
+ */
private boolean inJavadocComment = false;
/**
@@ -168,16 +187,14 @@
* Relative path to javadocs, suitable for hyperlinking
*/
private String javadocLinkDir;
-
- /*
+
+ /**
* Package Manager for this project.
*/
private PackageManager packageManager;
-
/**
* Constructor for the CodeTransform object
- *
* @param packageManager PackageManager for this project
*/
public CodeTransform(PackageManager packageManager)
@@ -186,10 +203,11 @@
loadHash();
}
-
/**
* Now different method of seeing if at end of input stream, closes inputs
* stream at end.
+ * @param line String
+ * @return filtered line of code
*/
public final String syntaxHighlight(String line)
{
@@ -198,6 +216,8 @@
/**
* Filter html tags into more benign text.
+ * @param line String
+ * @return html encoded line
*/
private final String htmlFilter(String line)
{
@@ -205,18 +225,18 @@
{
return "";
}
+ line = replace(line, "&", "&");
line = replace(line, "<", "<");
- line = replace(line, ">", ">");
line = replace(line, "\\\\", "//");
line = replace(line, "\\\"", "\\"");
line = replace(line, "'\"'", "'"'");
return multiLineCommentFilter(line);
}
-
/**
- * Filter out multiLine comments. State is kept with a private boolean
- * variable.
+ * Filter out multiLine comments. State is kept with a private boolean variable.
+ * @param line String
+ * @return String
*/
private final String multiLineCommentFilter(String line)
{
@@ -228,8 +248,7 @@
int index;
//First, check for the end of a java comment.
- if (inJavadocComment &&
- (index = line.indexOf("*/")) > -1 && !isInsideString(line, index))
+ if (inJavadocComment && (index = line.indexOf("*/")) > -1 && !isInsideString(line, index))
{
inJavadocComment = false;
buf.append(JAVADOC_COMMENT_START);
@@ -323,6 +342,8 @@
* either ignore the problem, or implement a function called something like
* isInsideString(line, index) where index points to some point in the line
* that we need to check... started doing this function below.
+ * @param line String
+ * @return String
*/
private final String inlineCommentFilter(String line)
{
@@ -348,6 +369,8 @@
/**
* Filters strings from a line of text and formats them properly.
+ * @param line String
+ * @return String
*/
private final String stringFilter(String line)
{
@@ -394,6 +417,8 @@
/**
* Filters keywords from a line of text and formats them properly.
+ * @param line String
+ * @return String
*/
private final String keywordFilter(String line)
{
@@ -402,19 +427,15 @@
return "";
}
StringBuffer buf = new StringBuffer();
- //HashMap usedReservedWords = new HashMap();
Hashtable usedReservedWords = new Hashtable();
int i = 0;
- int startAt = 0;
char ch;
StringBuffer temp = new StringBuffer();
while (i < line.length())
{
temp.setLength(0);
ch = line.charAt(i);
- startAt = i;
- while (i < line.length() && ((ch >= 65 && ch <= 90)
- || (ch >= 97 && ch <= 122)))
+ while (i < line.length() && ((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122)))
{
temp.append(ch);
i++;
@@ -441,13 +462,22 @@
/**
* Replace... I made it use a stringBuffer... hope it still works :)
+ * @param line String
+ * @param oldString String
+ * @param newString String
+ * @return String
*/
private final String replace(String line, String oldString, String newString)
{
int i = 0;
while ((i = line.indexOf(oldString, i)) >= 0)
{
- line = (new StringBuffer().append(line.substring(0, i)).append(newString).append(line.substring(i + oldString.length()))).toString();
+ line =
+ (new StringBuffer()
+ .append(line.substring(0, i))
+ .append(newString)
+ .append(line.substring(i + oldString.length())))
+ .toString();
i += newString.length();
}
return line;
@@ -456,6 +486,9 @@
/**
* Checks to see if some position in a line is between String start and
* ending characters. Not yet used in code or fully working :)
+ * @param line String
+ * @param position int
+ * @return boolean
*/
private final boolean isInsideString(String line, int position)
{
@@ -478,14 +511,7 @@
rightCount++;
right = right.substring(index + 1);
}
- if (rightCount % 2 != 0 && leftCount % 2 != 0)
- {
- return true;
- }
- else
- {
- return false;
- }
+ return (rightCount % 2 != 0 && leftCount % 2 != 0);
}
/**
@@ -550,52 +576,89 @@
/**
* Description of the Method
+ * @param oos ObjectOutputStream
+ * @throws IOException
*/
- final void writeObject(ObjectOutputStream oos)
- throws IOException
+ final void writeObject(ObjectOutputStream oos) throws IOException
{
oos.defaultWriteObject();
}
/**
* Description of the Method
+ * @param ois ObjectInputStream
+ * @throws ClassNotFoundException
+ * @throws IOException
*/
- final void readObject(ObjectInputStream ois)
- throws ClassNotFoundException, IOException
+ final void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException
{
ois.defaultReadObject();
}
/**
* Gets the header attribute of the CodeTransform object
+ * @todo make language and encoding headers customizable
+ * @return String
*/
public String getHeader()
{
- return "<html>\n" +
- "<body bgcolor=\"white\">\n" +
- "<pre>\n" + this.getFileOverview();
+ StringBuffer buffer = new StringBuffer();
+
+ // header
+ buffer
+ .append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n")
+ .append("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n")
+ .append("<head>\n")
+ .append("<meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\" />");
+
+ // title ("classname xref")
+ try
+ {
+ buffer
+ .append("<title>")
+ .append(FileManager.getInstance().getFile(this.getCurrentFilename()).getClassType().getName())
+ .append(" xref</title>\n");
+
+ }
+ catch (IOException e)
+ {
+ buffer.append("<title>xref</title>\n");
+ e.printStackTrace();
+ }
+
+ // stylesheet link
+ buffer
+ .append("<link type=\"text/css\" rel=\"stylesheet\" href=\"")
+ .append(this.getPackageRoot())
+ .append(STYLESHEET_FILENAME)
+ .append("\" />\n");
+
+ buffer.append("</head>\n").append("<body>\n").append(this.getFileOverview());
+
+ // start code section
+ buffer.append("<pre>\n");
+
+ return buffer.toString();
}
-
+
/**
* Gets the footer attribute of the CodeTransform object
+ * @return String
*/
public final String getFooter()
{
- return "</pre>\n" +
- "<hr>" +
- "<center>" + JXR.NOTICE + "</center>" +
- "</body>\n" +
- "</html>\n";
+ return "</pre>\n" + "<hr/>" + "<div id=\"footer\">" + JXR.NOTICE + "</div>" + "</body>\n" + "</html>\n";
}
-
/**
* This is the public method for doing all transforms of code.
+ * @param sourcefile String
+ * @param destfile String
+ * @param javadocLinkDir String
+ * @param revision String
+ * @throws IOException
*/
- public final void transform(String sourcefile,
- String destfile,
- String javadocLinkDir,
- String revision)
+ public final void transform(String sourcefile, String destfile, String javadocLinkDir, String revision)
throws IOException
{
@@ -611,103 +674,124 @@
FileReader fr = null;
FileWriter fw = null;
- try {
- fr = new FileReader(sourcefile);
- fw = new FileWriter(destfile);
- BufferedReader in = new BufferedReader(fr);
-
- PrintWriter out = new PrintWriter(fw);
-
- String line = "";
-
- out.println(getHeader());
-
- int linenumber = 1;
- while ((line = in.readLine()) != null)
- {
- if (LINE_NUMBERS)
+ try
+ {
+ fr = new FileReader(sourcefile);
+ fw = new FileWriter(destfile);
+ BufferedReader in = new BufferedReader(fr);
+
+ PrintWriter out = new PrintWriter(fw);
+
+ String line = "";
+
+ out.println(getHeader());
+
+ int linenumber = 1;
+ while ((line = in.readLine()) != null)
{
- out.print("<a name=\"" + linenumber + "\" " +
- "href=\"#" + linenumber + "\">" +
- linenumber +
- "</a>" + getLineWidth(linenumber));
- }
+ if (LINE_NUMBERS)
+ {
+ out.print(
+ "<a name=\""
+ + linenumber
+ + "\" "
+ + "href=\"#"
+ + linenumber
+ + "\">"
+ + linenumber
+ + "</a>"
+ + getLineWidth(linenumber));
+ }
- out.println(this.syntaxHighlight(line));
+ out.println(this.syntaxHighlight(line));
- ++linenumber;
- }
+ ++linenumber;
+ }
- out.println(getFooter());
- out.flush();
- } finally {
- if (fr != null) {
- try {
- fr.close();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- if (fw != null) {
- try {
- fw.close();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
+ out.println(getFooter());
+ out.flush();
+ }
+ finally
+ {
+ if (fr != null)
+ {
+ try
+ {
+ fr.close();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ if (fw != null)
+ {
+ try
+ {
+ fw.close();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
}
}
/**
* Get an overview header for this file.
+ * @return String
*/
private final String getFileOverview()
{
StringBuffer overview = new StringBuffer();
- overview.append("<table bgcolor=\"#FFFFCC\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">");
+ // only add the header if javadocs are present
+ if (javadocLinkDir != null)
+ {
+
+ overview.append("<div id=\"overview\">");
+ //get the URI to get Javadoc info.
+ StringBuffer javadocURI = new StringBuffer().append(getPackageRoot()).append(javadocLinkDir);
- if (javadocLinkDir != null) {
- //get the URI to get Javadoc info.
- StringBuffer javadocURI = new StringBuffer()
- .append(getPackageRoot())
- .append(javadocLinkDir);
-
- try
- {
- JavaFile jf = FileManager.getInstance().getFile(this.getCurrentFilename());
-
- javadocURI.append(StringUtils.replace(jf.getPackageType().getName(), ".", "/"));
- javadocURI.append("/");
- if (jf.getClassType() != null)
- {
- javadocURI.append(jf.getClassType().getName());
- }
- else
- {
- System.out.println(this.getCurrentFilename());
- }
- javadocURI.append(".html");
-
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
+ try
+ {
+ JavaFile jf = FileManager.getInstance().getFile(this.getCurrentFilename());
- String javadocHREF = "<a href=\"" + javadocURI + "\">View Javadoc</a>";
+ javadocURI.append(StringUtils.replace(jf.getPackageType().getName(), ".", "/"));
+ javadocURI.append("/");
+ if (jf.getClassType() != null)
+ {
+ javadocURI.append(jf.getClassType().getName());
+ }
+ else
+ {
+ System.out.println(this.getCurrentFilename());
+ }
+ javadocURI.append(".html");
- //get the generation time...
- overview.append(javadocHREF);
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+
+ String javadocHREF = "<a href=\"" + javadocURI + "\">View Javadoc</a>";
+
+ //get the generation time...
+ overview.append(javadocHREF);
+
+ overview.append("</div>");
}
- overview.append("</table>");
return overview.toString();
}
/**
* Handles line width which may need to change depending on which line
* number you are on.
+ * @param linenumber int
+ * @return String
*/
private final String getLineWidth(int linenumber)
{
@@ -728,6 +812,8 @@
/**
* Handles finding classes based on the current filename and then makes
* HREFs for you to link to them with.
+ * @param line String
+ * @return String
*/
private final String jxrFilter(String line)
{
@@ -781,8 +867,7 @@
//get the package from teh PackageManager because this will hold
//the version with the classes also.
- PackageType currentImport = packageManager
- .getPackageType(packages[j]);
+ PackageType currentImport = packageManager.getPackageType(packages[j]);
//the package here might in fact be null because it wasn't parsed out
//this might be something that is either not included or os part
@@ -806,18 +891,12 @@
//if there is a "." in the string then we have to assume
//it is a package.
- //System.out.println( "FIX ME: Currently working in package mode" );
-
-
String fqpn_package = null;
String fqpn_class = null;
fqpn_package = wordName.substring(0, wordName.lastIndexOf("."));
fqpn_class = wordName.substring(wordName.lastIndexOf(".") + 1, wordName.length());
- //System.out.println( "fqpn_package -> " + fqpn_package );
- //System.out.println( "fqpn_class -> " + fqpn_class );
-
//note. since this is a reference to a full package then
//it doesn't have to be explicitly imported so this information
//is useless. Instead just see if it was parsed out.
@@ -835,21 +914,17 @@
//that is in the package manager so it is time to
//link to it.
- //System.out.println( "FIX ME: Found explicit class reference: " + wordName );
line = xrLine(line, pt.getName(), ct);
}
}
- if (fqpn_package.equals(currentImport.getName()) &&
- currentImport.getClassType(fqpn_class) != null)
+ if (fqpn_package.equals(currentImport.getName()) && currentImport.getClassType(fqpn_class) != null)
{
//then the package we are currently in is the one specified in the string
//and the import class is correct.
-
- //System.out.println( "FIX ME: found class: " + wordName );
line = xrLine(line, packages[j], currentImport.getClassType(fqpn_class));
}
@@ -858,7 +933,6 @@
else if (currentImport.getClassType(wordName) != null)
{
- //System.out.println( "FIX ME: found imported class: "+ wordName );
line = xrLine(line, packages[j], currentImport.getClassType(wordName));
}
@@ -872,6 +946,7 @@
/**
* Get the current filename
+ * @return String
*/
public final String getCurrentFilename()
{
@@ -880,6 +955,7 @@
/**
* Set the current filename
+ * @param filename String
*/
public final void setCurrentFilename(String filename)
{
@@ -888,15 +964,16 @@
/**
* Given the current package, get an HREF to the package and class given
+ * @param dest String
+ * @param jc ClassType
+ * @return String
*/
- private final String getHREF(String dest,
- ClassType jc)
+ private final String getHREF(String dest, ClassType jc)
{
StringBuffer href = new StringBuffer();
//find out how to go back to the root
-
href.append(this.getPackageRoot());
//now find out how to get to the dest package
@@ -918,6 +995,8 @@
/**
* Based on the destination package, get the HREF.
+ * @param dest String
+ * @return String
*/
private final String getHREF(String dest)
{
@@ -925,12 +1004,11 @@
}
/**
- * <p>
- *
- * Given the name of a package... get the number of
- * subdirectories/subpackages there would be. </p> <p>
- *
- * EX: org.apache.maven == 3 </p>
+ * <p>Given the name of a package... get the number of
+ * subdirectories/subpackages there would be. </p>
+ * <p>EX: org.apache.maven == 3 </p>
+ * @param packageName String
+ * @return int
*/
private final int getPackageCount(String packageName)
{
@@ -966,6 +1044,8 @@
/**
* Parse out the current link and look for package/import statements and
* then create HREFs for them
+ * @param line String
+ * @return String
*/
private final String importFilter(String line)
{
@@ -981,9 +1061,7 @@
*/
boolean isPackage = line.indexOf("package") != -1;
- //
- if (line.indexOf("import") != -1 ||
- isPackage)
+ if (line.indexOf("import") != -1 || isPackage)
{
start = line.trim().indexOf(" ");
@@ -1005,13 +1083,13 @@
pkg = StringUtils.replace(pkg, ".*", "");
}
- else if (isPackage == false)
+ else if (!isPackage)
{
//this is an explicit Class import
String packageLine = pkg.toString();
-
+
// This catches a boundary problem where you have something like:
//
// Foo foo = FooMaster.getFooInstance().
@@ -1019,10 +1097,10 @@
//
// This breaks Jxr and won't be a problem when we hook
// in the real parser.
-
+
int a = packageLine.lastIndexOf(".") + 1;
int b = packageLine.length() - 1;
-
+
if (a > b + 1)
{
classname = packageLine.substring(packageLine.lastIndexOf(".") + 1, packageLine.length() - 1);
@@ -1043,33 +1121,27 @@
String pkgHREF = getHREF(pkg);
//if this package is within the PackageManager then you can create an HREF for it.
- if (packageManager.getPackageType(pkg) != null ||
- isPackage)
+ if (packageManager.getPackageType(pkg) != null || isPackage)
{
//Create an HREF for explicit classname imports
if (classname != null)
{
- line = StringUtils.replace(line, classname, "<a href=\"" +
- pkgHREF +
- "/" +
- classname +
- ".html" +
- "\">" +
- classname +
- "</a>");
+ line =
+ StringUtils.replace(
+ line,
+ classname,
+ "<a href=\"" + pkgHREF + "/" + classname + ".html" + "\">" + classname + "</a>");
}
//now replace the given package with a href
- line = StringUtils.replace(line, pkg, "<a href=\"" +
- pkgHREF +
- "/" +
- DirectoryIndexer.INDEX +
- "\">" +
- pkg +
- "</a>");
+ line =
+ StringUtils.replace(
+ line,
+ pkg,
+ "<a href=\"" + pkgHREF + "/" + DirectoryIndexer.INDEX + "\">" + pkg + "</a>");
}
}
@@ -1077,10 +1149,10 @@
return line;
}
-
/**
* From the current file, determine the package root based on the current
* path.
+ * @return String
*/
public final String getPackageRoot()
{
@@ -1113,6 +1185,8 @@
/**
* Given a line of text, search for URIs and make href's out of them
+ * @param line String
+ * @return String
*/
public final String uriFilter(String line)
{
@@ -1136,8 +1210,7 @@
char current = line.charAt(j);
- if (Character.isLetterOrDigit(current) == false &&
- isInvalidURICharacter(current))
+ if (!Character.isLetterOrDigit(current) && isInvalidURICharacter(current))
{
end = j;
break;
@@ -1155,21 +1228,17 @@
String uri = line.substring(start, end);
- line = StringUtils.replace(line, uri, "<a href=\"" +
- uri +
- "\" target=\"alexandria_uri\">" +
- uri +
- "</a>");
-
+ line =
+ StringUtils.replace(
+ line,
+ uri,
+ "<a href=\"" + uri + "\" target=\"alexandria_uri\">" + uri + "</a>");
}
-
}
-
}
//if we are in a multiline comment we should not call JXR here.
- if (inMultiLineComment == false &&
- inJavadocComment == false)
+ if (!inMultiLineComment && !inJavadocComment)
{
return jxrFilter(line);
}
@@ -1180,22 +1249,21 @@
}
-
/**
* if the given char is not one of the following in VALID_URI_CHARS then
* return true
+ * @param c char to check against VALID_URI_CHARS list
+ * @return <code>true</code> if c is a valid URI char
*/
private final boolean isInvalidURICharacter(char c)
{
for (int i = 0; i < VALID_URI_CHARS.length; ++i)
{
-
if (VALID_URI_CHARS[i] == c)
{
return false;
}
-
}
return true;
@@ -1203,6 +1271,7 @@
/**
* The current revision of the CVS module
+ * @return String
*/
public final String getRevision()
{
@@ -1211,6 +1280,7 @@
/**
* The current source file being read
+ * @return source file name
*/
public final String getSourcefile()
{
@@ -1219,6 +1289,7 @@
/**
* The current dest file being written
+ * @return destination file name
*/
public final String getDestfile()
{
@@ -1227,19 +1298,21 @@
/**
* The current source directory being read from.
+ * @return source directory
*/
public final String getSourceDirectory()
{
return this.sourcedir;
}
-
/**
* Cross Reference the given line with JXR returning the new content.
+ * @param line String
+ * @param packageName String
+ * @param classType ClassType
+ * @return String
*/
- public final String xrLine(String line,
- String packageName,
- ClassType classType)
+ public final String xrLine(String line, String packageName, ClassType classType)
{
StringBuffer buff = new StringBuffer(line);
@@ -1251,7 +1324,6 @@
if (classType != null)
{
href = this.getHREF(packageName, classType);
- //find = packageName + "." + classType.getName();
find = classType.getName();
}
else
@@ -1259,19 +1331,16 @@
href = this.getHREF(packageName);
find = packageName;
}
+
//build out what the link would be.
link = "<a href=\"" + href + "\">" + find + "</a>";
//use the SimpleWordTokenizer to find all entries
//that match word. Then replace these with the link
- //StringEntry se = SimpleWordTokenizer.tokenize( buff.toString(),
-
//now replace the word in the buffer with the link
-
String replace = link;
-
StringEntry[] tokens = SimpleWordTokenizer.tokenize(buff.toString(), find);
for (int l = 0; l < tokens.length; ++l)
@@ -1289,9 +1358,11 @@
/**
* Highlight the package in this line.
+ * @param line input line
+ * @param packageName package name
+ * @return input line with linked package
*/
- public final String xrLine(String line,
- String packageName)
+ public final String xrLine(String line, String packageName)
{
String href = this.getHREF(packageName);
@@ -1301,10 +1372,7 @@
//build out what the link would be.
String link = "<a href=\"" + href + "\">" + find + "</a>";
- //System.out.println( "find" );
-
return StringUtils.replace(line, find, link);
}
}
-
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org