java2html 用法

一個將JAVA源碼轉爲HTML的小東東.網址和介紹如下:http://www.java2html.de/

ant的定義如下:

<taskdef name="java2html"
  classname="de.java2html.anttasks.Java2HtmlTask"
  classpath="${lib.dir}"
 />
 <java2html
       srcdir="${src.dir}"
       destdir="htmlsource"
       includes="**/*.java"
       style="Kawa"
       showLineNumbers="true"
       showFileName="true"
    overwrite="true"
       showTableBorder="true"
    addLineAnchors="true"
 />

生成結果:

注意:

1 你必須把java2html.jar放到ant的lib包內

2 我把生成的html文件放到htmlsource文件夾,你可以自己更改

下面是生成結果:

007  /**
008    @author  diegoyun
009    @version  1.0
010    */
011  public class  XMLParser  {
012       private  XMLReader xmlReader =  null ;
013       private  String rootNodeName =  null ;
014 
015       public  XMLParser ( String url throws  XMLParserException  {
016 
017           this .xmlReader =  new  XMLReader ( url ) ;
018           this .rootNodeName = xmlReader.getRootNodeName () ;
019 
020       }

感謝該作者的無私分享.

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章