XDoclet is an open-source
code generation library
In computer science, a library is a collection of non-volatile resources used by computer programs, often for software development. These may include configuration data, documentation, help data, message templates, pre-written code and sub ...
that enables
Attribute-oriented programming
Attribute-oriented programming (@OP) is a technique for embedding metadata, namely attributes, within program code.
Attribute-oriented programming in various languages Java
With the inclusion of Metadata Facility for Java (JSR-175) into the ...
for
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
via insertion of special
Javadoc
Javadoc (originally cased JavaDoc) is a documentation generator created by Sun Microsystems for the Java language (now owned by Oracle Corporation) for generating API documentation in HTML format from Java source code. The HTML format is used ...
tags. It comes with a library of predefined tags, which simplify coding for various technologies:
Java EE
Jakarta EE, formerly Java Platform, Enterprise Edition (Java EE) and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE with specifications for enterprise features such as distributed computing and web se ...
,
Web services,
Portlet
The Java Portlet Specification defines a contract between the portlet container and portlets and provides a convenient programming model for Java portlet developers.
Portlets are pluggable user interface software components that are managed a ...
etc.
Example
A typical XDoclet comment might look like this:
/****
* This is the Account entity bean. It is an example of how to use the
* EJBDoclet tags.
*
* @see Customer
*
* @ejb.bean
* name="bank/Account"
* type="CMP"
* jndi-name="ejb/bank/Account"
* local-jndi-name="ejb/bank/LocalAccount"
* primkey-field="id"
* schema = "Customers"
*
* @ejb.finder
* signature="java.util.Collection findAll()"
* unchecked="true"
*
* @ejb.finder signature="java.util.Collection findByName(java.lang.String name)"
* unchecked="true"
* query= "SELECT OBJECT(o) FROM Customers AS o WHERE o.name
* LIKE ?1"
*
* @ejb.transaction
* type="Required"
*
* @ejb.interface
* remote-class="test.interfaces.Account"
*
* @ejb.value-object
* match="*"
*
* @version 1.5
*/
Books
*
References
External links
XDoclet project siteXDoclet2 project site
Java platform
Java development tools
Java (programming language) libraries
{{compu-library-stub