|
jtemplate is a package for emacs for initializing
easily class or interface for Java.
jtemplate uses an XML model for
defining a basic structure with XML
Tags. Thus, you can adapt the template result easily
with your usely coding style.
jtemplate can evaluate the template with an extra
data base (jtemplate-db.el) containing all standard
JDK interface (until JDK 1.4). Morever, it can navigate through all
your buffers and extract data for an interface implementation. For
instance, if you implement an interface located in a buffer,
jtemplate will add methods and imports as needed in the
final class.
jtemplate supports shortcuts when you specify the
implementations : You can use only
the class name without the package (for instance specify that
you implement ActionListener and not
java.awt.event.ActionListener).
jtemplate creates a sub-menu 'Java
Template' in the 'Tools' menu with all
available commands.
Using example :
C-j c
Class Name : jason.service.Controller
extends : jason.BasicController
implements: MouseListener,WindowListener
Main commands :
| C-c k c |
Build a new class (use full class name) |
| C-c k i |
Build a new interface (use full interface name) |
| C-c k p |
Set a default package name |
| C-c k o |
Open-source header Enabled/Disabled |
| C-c k m |
Main method Enabled/Disabled |
| C-c k v |
Show the jtemplate version |
Interface Model :
| <data:OPENSOURCE>package
<data:PACKAGE>;
<data:IMPORT>
/**
* <data:NAME>
* <B>Created
<data:TIME></B> *
* @author <data:USER-NAME>
(<data:USER-MAIL>)
* @version 1.0 * <data:SEE>
*/
public <data:ITEM>
<data:NAME>
<data:EXTENDS> {
<action:CURSOR>
<action:INDENT>
}
// <data:NAME> ends here
|
Class Model :
| <data:OPENSOURCE>package
<data:PACKAGE>;
<data:IMPORT>
/**
* <data:NAME>
* <B>Created
<data:TIME></B>
* @author <data:USER-NAME>
(<data:USER-MAIL>)
* @version 1.0 * <data:SEE>
*/
public <data:ITEM>
<data:NAME>
<data:EXTENDS>
<data:IMPLEMENTS> {
public <data:NAME>() {
super();
}
<action:CURSOR>
<action:INDENT>
<data:MAIN> }
// <data:NAME> ends here
|
| PACKAGE |
Class package extracting from the full class name |
| NAME |
Class or interface name |
| USER-MAIL |
The user e-mail from the user-mail-address
variable
Ex : (setq user-mail-address
"toto@toto.fr") in your .emacs.
|
| ITEM |
class or interface |
| IMPORT |
A list of 'import package.*' expression |
| EXTENDS |
Class or interface parent. |
| IMPLEMENTS |
Class or interface implementation. |
| TIME |
Current date & time |
| SEE |
A list of '* @see class' expression |
| MAIN |
Method method |
Back to the djefer's site
|