Home

Java2HTML

Description

The Java2HTML task coverts java source code into browsable and colourized HTML.

This task requires the j2h.jar to be on the class path. This is available from the www.java2html.com website.

FileSets should be specified to indicate which source code files should be included in the HTML output.

Parameters

Attribute Description Required
title the title that will be used in the HTML. No
simple Simple output, just include the Java source and stylesheet.css files. No
tabsize the number of spaces that tabs will be converted to, defaults to 4. No
marginsize sets the margin size, with line numbers, defaults to 0 with no line numbers. No
header Display header, defaults to 'yes'. No
footer Display footer, defaults to 'yes'. No
destination Output directory. No

Parameters specified as nested elements

fileset

The java2html  task supports any number of nested <fileset> elements. These are used  to specify the java files that are to be included in the Java2HTML output.

javadoc

The java2html task also supports any number of javadoc elements. The javadoc elements can be used to link the Java2HTML output to JavaDoc output files.

Attribute Description Required
localRef A local directory containing  the JavaDoc source. Yes
httpRef A Http Reference of the Java Doc source. No

 

Example

<taskdef name="java2html" classname="com.java2html.Java2HTMLTask"/>

<target name="main" >
	<java2html title="Example" 
		simple="no"
           	tabsize="4"
		marginsize="2"
		header="true"
		footer="false"
		destination="html">
		<fileset dir="C:\project\java">
			<include name="**/*.java"/>
		</fileset>
		<javadoc localRef="c:\jdk1.4\docs\api" httpRef="http://somewebsite.com/docs/api"/>
		<javadoc localRef="c:\ant\docs\api" httpRef="http://somewebsite.com/docs/api"/>
	</java2html>
</target>

.