2012-06-24 15:41:08 -04:00
|
|
|
## Access Modifiers
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet po
|
|
|
|
protected
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet pu
|
|
|
|
public
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet pr
|
|
|
|
private
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Annotations
|
|
|
|
snippet before
|
|
|
|
@Before
|
|
|
|
static void ${1:intercept}(${2:args}) { ${3} }
|
|
|
|
snippet mm
|
|
|
|
@ManyToMany
|
|
|
|
${1}
|
|
|
|
snippet mo
|
|
|
|
@ManyToOne
|
|
|
|
${1}
|
|
|
|
snippet om
|
|
|
|
@OneToMany${1:(cascade=CascadeType.ALL)}
|
|
|
|
${2}
|
|
|
|
snippet oo
|
|
|
|
@OneToOne
|
|
|
|
${1}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
|
|
|
## Basic Java packages and import
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet im
|
|
|
|
import
|
|
|
|
snippet j.b
|
|
|
|
java.beans.
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet j.i
|
|
|
|
java.io.
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet j.m
|
|
|
|
java.math.
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet j.n
|
|
|
|
java.net.
|
|
|
|
snippet j.u
|
|
|
|
java.util.
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Class
|
|
|
|
snippet cl
|
|
|
|
class ${1:`Filename("", "untitled")`} ${2}
|
|
|
|
snippet in
|
|
|
|
interface ${1:`Filename("", "untitled")`} ${2:extends Parent}${3}
|
|
|
|
snippet tc
|
|
|
|
public class ${1:`Filename()`} extends ${2:TestCase}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Class Enhancements
|
|
|
|
snippet ext
|
2013-06-20 17:39:31 -04:00
|
|
|
extends
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet imp
|
|
|
|
implements
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Comments
|
|
|
|
snippet /*
|
|
|
|
/*
|
|
|
|
* ${1}
|
|
|
|
*/
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Constants
|
|
|
|
snippet co
|
|
|
|
static public final ${1:String} ${2:var} = ${3};${4}
|
|
|
|
snippet cos
|
|
|
|
static public final String ${1:var} = "${2}";${3}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Control Statements
|
|
|
|
snippet case
|
|
|
|
case ${1}:
|
|
|
|
${2}
|
|
|
|
snippet def
|
|
|
|
default:
|
|
|
|
${2}
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet el
|
|
|
|
else
|
|
|
|
snippet elif
|
|
|
|
else if (${1}) ${2}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet if
|
|
|
|
if (${1}) ${2}
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet sw
|
2012-06-24 15:41:08 -04:00
|
|
|
switch (${1}) {
|
2012-05-21 22:17:30 -04:00
|
|
|
${2}
|
|
|
|
}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Create a Method
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet m
|
|
|
|
${1:void} ${2:method}(${3}) ${4:throws }${5}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Create a Variable
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet v
|
|
|
|
${1:String} ${2:var}${3: = null}${4};${5}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Enhancements to Methods, variables, classes, etc.
|
|
|
|
snippet ab
|
|
|
|
abstract
|
|
|
|
snippet fi
|
|
|
|
final
|
|
|
|
snippet st
|
|
|
|
static
|
|
|
|
snippet sy
|
|
|
|
synchronized
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Error Methods
|
|
|
|
snippet err
|
|
|
|
System.err.print("${1:Message}");
|
|
|
|
snippet errf
|
|
|
|
System.err.printf("${1:Message}", ${2:exception});
|
|
|
|
snippet errln
|
|
|
|
System.err.println("${1:Message}");
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Exception Handling
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet as
|
|
|
|
assert ${1:test} : "${2:Failure message}";${3}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet ca
|
|
|
|
catch(${1:Exception} ${2:e}) ${3}
|
|
|
|
snippet thr
|
|
|
|
throw
|
|
|
|
snippet ths
|
|
|
|
throws
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet try
|
|
|
|
try {
|
|
|
|
${3}
|
|
|
|
} catch(${1:Exception} ${2:e}) {
|
|
|
|
}
|
|
|
|
snippet tryf
|
|
|
|
try {
|
|
|
|
${3}
|
|
|
|
} catch(${1:Exception} ${2:e}) {
|
|
|
|
} finally {
|
|
|
|
}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Find Methods
|
|
|
|
snippet findall
|
|
|
|
List<${1:listName}> ${2:items} = ${1}.findAll();${3}
|
|
|
|
snippet findbyid
|
|
|
|
${1:var} ${2:item} = ${1}.findById(${3});${4}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Javadocs
|
|
|
|
snippet /**
|
|
|
|
/**
|
|
|
|
* ${1}
|
|
|
|
*/
|
2012-01-01 06:08:21 -05:00
|
|
|
snippet @au
|
2012-09-07 21:50:11 -04:00
|
|
|
@author `system("grep \`id -un\` /etc/passwd | cut -d \":\" -f5 | cut -d \",\" -f1")`
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet @br
|
|
|
|
@brief ${1:Description}
|
|
|
|
snippet @fi
|
|
|
|
@file ${1:`Filename()`}.java
|
|
|
|
snippet @pa
|
|
|
|
@param ${1:param}
|
|
|
|
snippet @re
|
|
|
|
@return ${1:param}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Logger Methods
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet debug
|
|
|
|
Logger.debug(${1:param});${2}
|
|
|
|
snippet error
|
|
|
|
Logger.error(${1:param});${2}
|
|
|
|
snippet info
|
|
|
|
Logger.info(${1:param});${2}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet warn
|
|
|
|
Logger.warn(${1:param});${2}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Loops
|
|
|
|
snippet enfor
|
|
|
|
for (${1} : ${2}) ${3}
|
|
|
|
snippet for
|
|
|
|
for (${1}; ${2}; ${3}) ${4}
|
|
|
|
snippet wh
|
|
|
|
while (${1}) ${2}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Main method
|
|
|
|
snippet main
|
|
|
|
public static void main (String[] args) {
|
2013-06-20 17:33:44 -04:00
|
|
|
${1}
|
2012-06-24 15:41:08 -04:00
|
|
|
}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Print Methods
|
|
|
|
snippet print
|
2012-09-30 18:04:56 -04:00
|
|
|
System.out.print("${1:Message}");
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet printf
|
2012-09-30 18:04:56 -04:00
|
|
|
System.out.printf("${1:Message}", ${2:args});
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet println
|
|
|
|
System.out.println(${1});
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Render Methods
|
2011-06-20 13:40:28 -04:00
|
|
|
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}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Setter and Getter Methods
|
|
|
|
snippet set
|
2012-07-20 07:15:09 -04:00
|
|
|
${1:public} void set${3:}(${2:String} ${4:}){
|
2012-01-24 16:52:38 -05:00
|
|
|
this.$4 = $4;
|
|
|
|
}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet get
|
2012-01-24 16:52:38 -05:00
|
|
|
${1:public} ${2:String} get${3:}(){
|
|
|
|
return this.${4:};
|
|
|
|
}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Terminate Methods or Loops
|
|
|
|
snippet re
|
|
|
|
return
|
|
|
|
snippet br
|
|
|
|
break;
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Test Methods
|
|
|
|
snippet t
|
|
|
|
public void test${1:Name}() throws Exception {
|
|
|
|
${2}
|
|
|
|
}
|
|
|
|
snippet test
|
|
|
|
@Test
|
|
|
|
public void test${1:Name}() throws Exception {
|
|
|
|
${2}
|
|
|
|
}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Utils
|
|
|
|
snippet Sc
|
|
|
|
Scanner
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Miscellaneous
|
|
|
|
snippet action
|
|
|
|
public static void ${1:index}(${2:args}) { ${3} }
|
|
|
|
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 unless
|
|
|
|
(unless=${1:param});${2}
|