incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r797140 - /incubator/kato/trunk/org.apache.kato/kato.anttasks/src/main/java/org/apache/kato/anttasks/xmlgen/XMLWriter.java
Date Thu, 23 Jul 2009 16:37:04 GMT
Author: spoole
Date: Thu Jul 23 16:37:03 2009
New Revision: 797140

URL: http://svn.apache.org/viewvc?rev=797140&view=rev
Log:
expose javadoc method throws info into xml file

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=797140&r1=797139&r2=797140&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 16:37:03 2009
@@ -23,6 +23,7 @@
 import com.sun.javadoc.Parameter;
 import com.sun.javadoc.SeeTag;
 import com.sun.javadoc.Tag;
+import com.sun.javadoc.ThrowsTag;
 import com.sun.javadoc.Type;
 
 public class XMLWriter {
@@ -117,12 +118,27 @@
 		Tag[] returnTags=m.tags("return");
 		writeReturnTags(returnTags);
 		
+		ThrowsTag[] throwsTags=m.throwsTags();
+		writeThrowsTags(throwsTags);
+		
 		SeeTag[] seetags=m.seeTags();
 		writeSeeTags(seetags);
 		
 		write("</method>");
 		
 	}
+	private void writeThrowsTags(ThrowsTag[] throwsTags) {
+		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);
+			write("</throw>");
+		}
+		write("</throws>");
+	}
 	private void writeReturnTags(Tag[] returnTags) throws IOException {
 		if(returnTags==null || returnTags.length==0) return; // nothing to do
 		write("<returns>");



Mime
View raw message