Merge from emacs-23; up to 2010-06-12T08:59:37Z!albinus@detlef.
[bpt/emacs.git] / etc / srecode / java.srt
CommitLineData
c05676c5
CY
1;; java.srt
2
73b0cd50 3;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
c05676c5
CY
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "java-mode"
23set escape_start "{{"
24set escape_end "}}"
25
26context file
27
28set comment_start "/**"
29set comment_end " */"
30set comment_prefix " *"
31
32template empty :file :user :time :java :indent
33"Fill out an empty file."
34sectiondictionary "CLASSSECTION"
35set NAME macro "FILENAME_AS_CLASS"
36----
37{{>:filecomment}}
38
39package {{FILENAME_AS_PACKAGE}};
40
41{{>CLASSSECTION:declaration:class}}
42
43----
44bind "e"
45
46context declaration
47
48template import :blank :indent
49"Template to import a package."
50----
51{{>:declaration:include}}
52----
53bind "i"
54
55template class :blank :indent
56"Template to declare a variable."
57sectiondictionary "DOCSECTION"
58set NAME macro "NAME"
59----
60{{>DOCSECTION:declaration:javadoc-class}}
61public class {{?NAME}} {
62
63 {{^}}
64
65} // {{NAME}}
66----
67bind "c"
68
69;;; Semantic Tag support
70;;
71template class-tag :indent :blank
72"Insert a Java class with the expectation of it being used by a tag inserter.
73Override this to affect applications, or the outer class structure for
74the user-facing template."
75----
76{{>:declaration:javadoc-class}}
77public Class {{?NAME}} {{#PARENTS}}{{#FIRST}}extends {{/FIRST}}{{#NOTFIRST}}implements {{/NOTFIRST}}{{NAME}}{{/PARENTS}}
78{
79 {{^}}
80};
81----
82
83template include :blank
84"An include statement."
85----
b9749554 86import {{?NAME}};
c05676c5
CY
87----
88
89context misc
90
91template arglist
92"Insert an argument list for a function.
93@todo - Support smart CR in a buffer for not too long lines."
94----
95({{#ARGS}}{{TYPE}} {{NAME}}{{#NOTLAST}},{{/NOTLAST}}{{/ARGS}})
96----
97
98context classdecl
99
100template function :indent :blank
101----
102public {{?TYPE}} {{?NAME}}{{>:misc:arglist}} {
103{{^}}
104}
105----
106bind "m"
107
108template variable :indent :blank
109"Insert a variable declaration."
110----
111{{?TYPE}} {{?NAME}}{{#HAVEDEFAULT}} = {{DEFAULT}}{{/HAVEDEFAULT}};
112----
113bind "v"
114
115;;; Java Doc Comments
116;;
117context classdecl
118
119prompt GROUPNAME "Name of declaration group: "
120
121template javadoc-function-group-start :indent :blank
122----
123/**
124 * {{?GROUPNAME}}
125 * @{
126 */
127
128----
129
130template javadoc-function-group-end :indent :blank
131----
132/**
133 * @}
134 */
135
136----
137
138context declaration
139
140template javadoc-class :indent :blank :time :user :tag
141----
142/**
143 * {{DOC}}{{^}}
144 *
145 * Created: {{DATE}}
146 *
147 * @author {{AUTHOR}}
148 * @version
149 * @since
150 */
151----
152
153template javadoc-function :indent :blank :tag
154----
155/**
156 * {{DOC}}{{^}}
157 * {{#ARGS}}
158 * @param {{?NAME}} - {{DOC}}{{/ARGS}}
159 * @return {{TYPE}}{{#THROWS}}
160 * @exception {{NAME}} - {{EXDOC}}{{/THROWS}}
161 */
162----
163
164template javadoc-variable-same-line
165----
166/**< {{DOC}}{{^}} */
167----
168
169template javadoc-section-comment :blank :indent
170"Insert a comment that separates sections of an Emacs Lisp file."
171----
172\f
173/** {{?TITLE}}
174 *
175 * {{^}}
176 */
177
178----
179
180
114f9c96 181;; end