incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r797397 - /incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java
Date Fri, 24 Jul 2009 09:50:22 GMT
Author: spoole
Date: Fri Jul 24 09:50:22 2009
New Revision: 797397

URL: http://svn.apache.org/viewvc?rev=797397&view=rev
Log:
updated xml writer to balance html tags etc in all comments

Modified:
    incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java

Modified: incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java?rev=797397&r1=797396&r2=797397&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java
Fri Jul 24 09:50:22 2009
@@ -127,14 +127,14 @@
 		write("</method>");
 		
 	}
-	private void writeThrowsTags(ThrowsTag[] throwsTags) {
+	private void writeThrowsTags(ThrowsTag[] throwsTags) throws IOException {
 		if(throwsTags==null || throwsTags.length==0) return; // nothing to do
 		write("<throws>");
 		for(ThrowsTag t:throwsTags) {
 			String name=t.exceptionName();
 			String comment=t.exceptionComment();
 			write("<throw name=\""+name+"\">");
-			write(comment);
+			writeHTMLFormattedText(comment);
 			write("</throw>");
 		}
 		write("</throws>");
@@ -161,7 +161,7 @@
 		write("<see>"+seetag.text()+"</see>");
 		
 	}
-	private void write(ParamTag[] parameters) {
+	private void write(ParamTag[] parameters) throws IOException {
 		if(parameters==null || parameters.length==0) return;
 		write("<paramdescs>");
 		for(ParamTag p:parameters) {
@@ -170,12 +170,12 @@
 		write("</paramdescs>");
 		
 	}
-	private void write(ParamTag p) {
+	private void write(ParamTag p) throws IOException {
 		String name=p.parameterName();
 		write("<paramdesc name=\""+name+"\">");
 		String comment=p.parameterComment();
-		if(comment==null ) {
-			write(comment);
+		if(comment!=null ) {
+			writeHTMLFormattedText(comment);
 		}
 		write("</paramdesc>");
 	}
@@ -217,10 +217,22 @@
 		if(commentText==null) return;
 		commentText=commentText.trim();
 		if(commentText.equals("")) return;
+		
+		write("<"+tag+">");
+		writeHTMLFormattedText(commentText);
+        
+        write("</"+tag+">");				
+		
+		
+	}
+	private void writeHTMLFormattedText(String commentText) throws IOException {
+		
+		if(commentText==null) return;
+		commentText=commentText.trim();
+		if(commentText.equals("")) return;
 		if(commentText.startsWith("<p>")==false) {
 			commentText="<p>"+commentText;
 		}
-		write("<"+tag+">");
 		DOMFragmentParser parser = new DOMFragmentParser();
 		
 		HTMLDocument document = new HTMLDocumentImpl();
@@ -236,10 +248,6 @@
 		
 		
         write(fragment);
-        
-        write("</"+tag+">");				
-		
-		
 	}
 	private void write(DocumentFragment fragment) {
 		
@@ -291,15 +299,21 @@
 		if(name.equals("H3")) name="db:sect4";
 		if(name.equals("H4")) name="db:sect5";
 		if(name.equals("P")) name="db:para";
+		if(name.equals("I")) name="db:emphasis";
 		if(name.equals("TABLE")) name="db:informaltable";
 		if(name.equals("TR")) name="db:row";
 		if(name.equals("TD")) name="db:entry";
 		if(name.equals("TH")) name="db:thead";
 		if(name.equals("UL")) name="db:itemizedlist";
+		if(name.equals("DL")) name="db:itemizedlist";
 		if(name.equals("OL")) name="db:orderedlist";
-		if(name.equals("LI")) name="db:listitem"; 
+		if(name.equals("LI")) name="db:listitem";
+		if(name.equals("DD")) name="db:listitem";
+		if(name.equals("DT")) name="db:listitem";
 		if(name.equals("A")) name="db:link";
 		if(name.equals("PRE")) name="db:programlisting";
+		if(name.equals("CODE")) name="db:programlisting";
+		if(name.equals("BR")) name="db:para";
 		return name;
 	}
 	public void writeInterface(ClassDoc c) throws IOException {



Mime
View raw message