incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r797042 - /incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java
Date Thu, 23 Jul 2009 12:33:36 GMT
Author: spoole
Date: Thu Jul 23 12:33:35 2009
New Revision: 797042

URL: http://svn.apache.org/viewvc?rev=797042&view=rev
Log:
updated xml javadoc ant task to include method summary info

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=797042&r1=797041&r2=797042&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
Thu Jul 23 12:33:35 2009
@@ -77,6 +77,7 @@
 		SeeTag[] seetags=c.seeTags();
 		writeSeeTags(seetags);
 		
+		writeModifiers(c.modifiers());
 		writeElement("extends",c.superclass().qualifiedName());
 		
 		
@@ -84,6 +85,10 @@
 		write("</class>");
 		
 	}
+	private void writeModifiers(String modifiers) {
+		write("<modifiers>"+modifiers+"</modifiers>");
+		
+	}
 	private void writeElement(String elementName, String text) {
 		write("<"+elementName+">"+text+"</"+elementName+">");
 		
@@ -105,7 +110,7 @@
 		
 		Type t=m.returnType();
 		writeType("returntype",t);
-		write("<modifiers>"+m.modifiers()+"</modifiers>");
+		writeModifiers(m.modifiers());
 		writeSummary(m.firstSentenceTags());
 		writeComment(m.commentText());
 		
@@ -180,12 +185,16 @@
 	}
 	
 	private void writeComment(String text) throws IOException {
-		writeText("comment",text);
+		writeHTMLText("comment",text);
 	}
-	private void writeText(String tag,String commentText) throws IOException {
+	private void writeHTMLText(String tag,String commentText) throws IOException {
 		
 		if(commentText==null) return;
-		if(commentText.trim().equals("")) return;
+		commentText=commentText.trim();
+		if(commentText.equals("")) return;
+		if(commentText.startsWith("<p>")==false) {
+			commentText="<p>"+commentText;
+		}
 		write("<"+tag+">");
 		DOMFragmentParser parser = new DOMFragmentParser();
 		
@@ -251,7 +260,7 @@
 		
 	}
 	private String mapNameToDocBook(String name) {
-		if(name.equals("BR")) name="html:br";
+		name=name.toUpperCase();
 		if(name.equals("H1")) name="db:sect2";
 		if(name.equals("H2")) name="db:sect3";
 		if(name.equals("H3")) name="db:sect4";
@@ -276,6 +285,7 @@
 		if(parent!=null) {
 			writeElement("extends",parent.qualifiedName());
 		}
+		writeModifiers(c.modifiers());
 		write("</interface>");
 		
 	}
@@ -317,7 +327,7 @@
 		}
 	}
 	private void writeSummary(String text) throws IOException {
-		writeText("summary",text);
+		writeHTMLText("summary",text);
 		
 	}
 



Mime
View raw message