Lunatech Labs

 

jax-doclets usage

jax-doclets project home page

Documentation comments

Here's an example of JavaDoc for JAX-RS:

/**
 * This is our order resource
 */
@Path("/order")
@Produces("application/xml")
public class Order {

 /**
  * Gets a single order
  * @param orderKey the order key
  * @return the order if found
  * @HTTP 404 order not found
  */
 @GET
 @Path("{id}")
 public Order getOrder(@PathParam("id") String orderKey){…}

 /**
  * Gets every order
  * @return every order
  * @returnWrapped com.foo.OrderList
  */
 @GET
 public Response getOrders(){…}

 /**
  * Uploads an order
  * @param order the order to upload
  * @inputWrapped com.foo.Order
  */
 @POST
 public void postOrder(String orderAsString){…}

}

Ant

Once you have downloaded our doclets jar, simply use the following ant task:

 <path id="compile.classpath">
  <pathelement location=".../jax-doclets-0.10.0.jar"/>
 </path>

 <target name="jax-doc-jaxrs" description="Generate JAX-RS documentation">
  <javadoc classpathref="compile.classpath" sourcepath="${src.dir}"
           destdir="${build.dir}/jaxrsdocs/" extdirs="${lib.dir}"
           doclet="com.lunatech.doclets.jax.jaxrs.JAXRSDoclet"
           docletpathref="compile.classpath">
   <link href="../jaxbdocs/"/>
  </javadoc>
 </target>
	
 <target name="jax-doc-jaxb" description="Generate JAXB documentation">
  <javadoc classpathref="compile.classpath" sourcepath="${src.dir}"
           destdir="${build.dir}/jaxbdocs/" extdirs="${lib.dir}"
           doclet="com.lunatech.doclets.jax.jaxb.JAXBDoclet"
           docletpathref="compile.classpath">
  </javadoc>
 </target>

 <target name="jax-doc-jpa" description="Generate JPA documentation">
  <javadoc classpathref="compile.classpath" sourcepath="${src.dir}"
           destdir="${build.dir}/jpadocs/" extdirs="${lib.dir}"
           doclet="com.lunatech.doclets.jax.jpa.JPADoclet"
           docletpathref="compile.classpath">
  </javadoc>
 </target>

Maven

Or using Maven:

 <reporting>
  <plugins>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>2.7</version>
    <reportSets>
     <reportSet>
      <id>jaxb</id>
      <configuration>
       <doclet>com.lunatech.doclets.jax.jaxb.JAXBDoclet</doclet>
       <docletArtifacts>
        <docletArtifact>
         <groupId>com.lunatech.jax-doclets</groupId>
         <artifactId>doclets</artifactId>
         <version>0.10.0</version>
        </docletArtifact>
       </docletArtifacts>
       <destDir>jaxbdocs</destDir>
      </configuration>
      <reports>
       <report>javadoc</report>
      </reports>
     </reportSet>
     <reportSet>
      <configuration>
       <doclet>com.lunatech.doclets.jax.jaxrs.JAXRSDoclet</doclet>
       <docletArtifacts>
        <docletArtifact>
         <groupId>com.lunatech.jax-doclets</groupId>
         <artifactId>doclets</artifactId>
         <version>0.10.0</version>
        </docletArtifact>
       </docletArtifacts>
       <destDir>jaxrsdocs</destDir>
       <links>
        <link>../jaxbdocs/</link>
       </links>
      </configuration>
      <reports>
       <report>javadoc</report>
      </reports>
     </reportSet>
     <reportSet>
      <id>jpa</id>
      <configuration>
       <doclet>com.lunatech.doclets.jax.jpa.JPADoclet</doclet>
       <docletArtifacts>
        <docletArtifact>
         <groupId>com.lunatech.jax-doclets</groupId>
         <artifactId>doclets</artifactId>
         <version>0.10.0</version>
        </docletArtifact>
       </docletArtifacts>
       <destDir>jpadocs</destDir>
      </configuration>
      <reports>
       <report>javadoc</report>
      </reports>
     </reportSet>
    </reportSets>
   </plugin>
  </plugins>
 </reporting>

About Lunatech

Lunatech Research was founded in 1993 as an IT consulting, product research and development team. Lunatech is a team of adept self-managing programmers, working with a very experienced commercial team.

Contact us

Lunatech Research B.V.
Heemraadssingel 70
3021 DD Rotterdam, The Netherlands.

Phone and email

Tel: +31 10 750 2600
Fax: +31 10 243 9902
Email: contact@lunatech.com