jtemplate 1.1

27/12/01


Description

Default Models
Tags

Download

 
Description

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

Click here for result

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

XML-like models

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


XML-like tags

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

Download

Version 1.1

jtemplate.el | jtemplate-db.el

Please download both files !

Eliminate extra blank while merging the model with data

Change the keyboard mapping to C-c k prefix

Search in all buffers for interface implementation !

Correction for the tied jtemplate-db.el file (it can work without too...)

Add a 'Java Template' sub-menu in the 'Tools' menu

Update models to be more compatible with the Java Doc specification.

Version 1.0

jtemplate.el | jtemplate-db.el

Please download both files !

jtemplate.el contains the jtemplate lisp code

jtemplate-db.el contains a database for all the JDK 1.4 interfaces for generating your class body


Back to the djefer's site