You can use the DITA API specialization to author and generate API reference documentation for Java and other programming languages.
The DITA API specialization documentation describes the XML based DITA architecture through the document type definition (DTD) elements for generic (all programming languages) and Java programming language. The DITA API specialization includes topic types and elements for documenting generic and Java API refrences. Each language-specific DITA API specialization consists of modules. A module is topic type designed for a specific task such as describing an API package or class. Each module includes the appropriate XML elements to describe a specific part of the programming language.
The topic type module describes the contained XML elements. A topic type module has a dependency on the topic type modules that, for its contained specialized elements, provide the base XML elements.