forked from scrooloose/snipmate-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
java.snippets
157 lines (157 loc) · 2.71 KB
/
java.snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
snippet main
public static void main (String[] args) {
${1:/* code */}
}
snippet pu
public
snippet po
protected
snippet pr
private
snippet st
static
snippet fi
final
snippet ab
abstract
snippet re
return
snippet br
break;
snippet de
default:
${1}
snippet ca
catch(${1:Exception} ${2:e}) ${3}
snippet th
throw
snippet sy
synchronized
snippet im
import
snippet imp
implements
snippet ext
extends
snippet j.u
java.util
snippet j.i
java.io.
snippet j.b
java.beans.
snippet j.n
java.net.
snippet j.m
java.math.
snippet if
if (${1}) ${2}
snippet el
else
snippet elif
else if (${1}) ${2}
snippet wh
while (${1}) ${2}
snippet for
for (${1}; ${2}; ${3}) ${4}
snippet fore
for (${1} : ${2}) ${3}
snippet sw
switch (${1}) ${2}
snippet cs
case ${1}:
${2}
${3}
snippet tc
public class ${1:`Filename()`} extends ${2:TestCase}
snippet t
public void test${1:Name}() throws Exception ${2}
snippet cl
class ${1:`Filename("", "untitled")`} ${2}
snippet in
interface ${1:`Filename("", "untitled")`} ${2:extends Parent}${3}
snippet m
${1:void} ${2:method}(${3}) ${4:throws }${5}
snippet v
${1:String} ${2:var}${3: = null}${4};${5}
snippet co
static public final ${1:String} ${2:var} = ${3};${4}
snippet cos
static public final String ${1:var} = "${2}";${3}
snippet as
assert ${1:test} : "${2:Failure message}";${3}
snippet try
try {
${3}
} catch(${1:Exception} ${2:e}) {
}
snippet tryf
try {
${3}
} catch(${1:Exception} ${2:e}) {
} finally {
}
snippet rst
ResultSet ${1:rst}${2: = null}${3};${4}
snippet @au
@author `system("grep \`id -un\` /etc/passwd | cut -d \":\" -f5")`
snippet mm
@ManyToMany
${1}
snippet mo
@ManyToOne
${1}
snippet om
OneToMany${1:(cascade=CascadeType.ALL)}
${2}
snippet oo
@OneToOne
${1}
snippet action
public static void ${1:index}(${2:args}) { ${3} }
snippet before
@Before
static void ${1:intercept}(${2:args}) { ${3} }
snippet debug
Logger.debug(${1:param});${2}
snippet error
Logger.error(${1:param});${2}
snippet findall
List<${1:listName}> ${2:items} = ${1}.findAll();${3}
snippet findbyid
${1:var} ${2:item} = ${1}.findById(${3});${4}
snippet info
Logger.info(${1:param});${2}
snippet rnf
notFound(${1:param});${2}
snippet rnfin
notFoundIfNull(${1:param});${2}
snippet rr
redirect(${1:param});${2}
snippet ru
unauthorized(${1:param});${2}
snippet ren
render(${1:param});${2}
snippet rena
renderArgs.put("${1}", ${2});${3}
snippet renb
renderBinary(${1:param});${2}
snippet renj
renderJSON(${1:param});${2}
snippet renx
renderXml(${1:param});${2}
snippet unless
(unless=${1:param});${2}
snippet warn
Logger.warn(${1:param});${2}
snippet sysout
System.out.println(${1});
snippet syserr
System.err.println(${1});
snippet /*
/*
* ${1}
*/
snippet /**
/**
* ${1}
*/