2012-06-24 15:41:08 -04:00
|
|
|
## Access Modifiers
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet po
|
2014-06-09 11:34:32 -04:00
|
|
|
protected ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet pu
|
2014-06-09 11:34:32 -04:00
|
|
|
public ${0}
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet pr
|
2014-06-09 11:34:32 -04:00
|
|
|
private ${0}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Annotations
|
|
|
|
snippet before
|
|
|
|
@Before
|
2013-07-25 17:17:32 -04:00
|
|
|
static void ${1:intercept}(${2:args}) { ${0} }
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet mm
|
|
|
|
@ManyToMany
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet mo
|
|
|
|
@ManyToOne
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet om
|
|
|
|
@OneToMany${1:(cascade=CascadeType.ALL)}
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
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
|
2014-06-09 11:34:32 -04:00
|
|
|
import ${0}
|
2011-06-20 13:40:28 -04:00
|
|
|
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
|
2014-06-09 11:29:58 -04:00
|
|
|
class ${1:`vim_snippets#Filename("$1", "untitled")`} ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet in
|
2014-06-09 11:29:58 -04:00
|
|
|
interface ${1:`vim_snippets#Filename("$1", "untitled")`} ${2:extends Parent}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet tc
|
2014-06-09 11:29:58 -04:00
|
|
|
public class ${1:`vim_snippets#Filename("$1")`} extends ${0:TestCase}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Class Enhancements
|
|
|
|
snippet ext
|
2014-06-09 11:34:32 -04:00
|
|
|
extends ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet imp
|
2014-06-09 11:34:32 -04:00
|
|
|
implements ${0}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Comments
|
|
|
|
snippet /*
|
|
|
|
/*
|
2013-07-25 17:17:32 -04:00
|
|
|
* ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
*/
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Constants
|
|
|
|
snippet co
|
2013-07-25 17:17:32 -04:00
|
|
|
static public final ${1:String} ${2:var} = ${3};
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet cos
|
2013-07-25 17:17:32 -04:00
|
|
|
static public final String ${1:var} = "${2}";
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Control Statements
|
|
|
|
snippet case
|
|
|
|
case ${1}:
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet def
|
|
|
|
default:
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet el
|
|
|
|
else
|
2013-06-22 20:30:26 -04:00
|
|
|
snippet eif
|
2013-07-25 17:17:32 -04:00
|
|
|
else if (${1}) ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet if
|
2013-07-25 17:17:32 -04:00
|
|
|
if (${1}) ${0}
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet sw
|
2012-06-24 15:41:08 -04:00
|
|
|
switch (${1}) {
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2012-05-21 22:17:30 -04:00
|
|
|
}
|
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
|
2013-07-25 17:17:32 -04:00
|
|
|
${1:void} ${2:method}(${3}) ${4:throws }
|
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
|
2013-07-25 17:17:32 -04:00
|
|
|
${1:String} ${2:var}${3: = null}${4};
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2014-06-09 13:10:02 -04:00
|
|
|
## Declaration for ArrayList
|
|
|
|
snippet d.al
|
|
|
|
List<${1:Object}> ${2:list} = ArrayList<$1>;${0}
|
|
|
|
## Declaration for HashMap
|
|
|
|
snippet d.hm
|
|
|
|
Map<${1:Object}, ${2:Object}> ${3:map} = HashMap<$1, $2>;${0}
|
|
|
|
## Declaration for HashSet
|
|
|
|
snippet d.hs
|
|
|
|
Set<${1:Object}> ${2:set} = HashSet<$1>;${0}
|
|
|
|
## Declaration for Stack
|
|
|
|
snippet d.st
|
|
|
|
Stack<${1:Object}> ${2:stack} = Stack<$1>;${0}
|
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Enhancements to Methods, variables, classes, etc.
|
|
|
|
snippet ab
|
2014-06-09 11:34:32 -04:00
|
|
|
abstract ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet fi
|
2014-06-09 11:34:32 -04:00
|
|
|
final ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet st
|
2014-06-09 11:34:32 -04:00
|
|
|
static ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet sy
|
2014-06-09 11:34:32 -04:00
|
|
|
synchronized ${0}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Error Methods
|
|
|
|
snippet err
|
2013-07-25 17:17:32 -04:00
|
|
|
System.err.print("${0:Message}");
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet errf
|
2013-07-25 17:17:32 -04:00
|
|
|
System.err.printf("${1:Message}", ${0:exception});
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet errln
|
2013-07-25 17:17:32 -04:00
|
|
|
System.err.println("${0: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
|
2013-07-25 17:17:32 -04:00
|
|
|
assert ${1:test} : "${2:Failure message}";
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet ca
|
2013-07-25 17:17:32 -04:00
|
|
|
catch(${1:Exception} ${2:e}) ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet thr
|
2014-06-09 11:34:32 -04:00
|
|
|
throw ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet ths
|
2014-06-09 11:34:32 -04:00
|
|
|
throws ${0}
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet try
|
|
|
|
try {
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2011-06-20 13:40:28 -04:00
|
|
|
} catch(${1:Exception} ${2:e}) {
|
|
|
|
}
|
|
|
|
snippet tryf
|
|
|
|
try {
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2011-06-20 13:40:28 -04:00
|
|
|
} 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
|
2013-07-25 17:17:32 -04:00
|
|
|
List<${1:listName}> ${2:items} = ${1}.findAll();
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet findbyid
|
2013-07-25 17:17:32 -04:00
|
|
|
${1:var} ${2:item} = ${1}.findById(${3});
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Javadocs
|
|
|
|
snippet /**
|
|
|
|
/**
|
2013-07-25 17:17:32 -04:00
|
|
|
* ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
*/
|
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
|
2013-07-25 17:17:32 -04:00
|
|
|
@brief ${0:Description}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet @fi
|
2014-06-09 11:29:58 -04:00
|
|
|
@file ${0:`vim_snippets#Filename("$1")`}.java
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet @pa
|
2013-07-25 17:17:32 -04:00
|
|
|
@param ${0:param}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet @re
|
2013-07-25 17:17:32 -04:00
|
|
|
@return ${0: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
|
2013-07-25 17:17:32 -04:00
|
|
|
Logger.debug(${1:param});
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet error
|
2013-07-25 17:17:32 -04:00
|
|
|
Logger.error(${1:param});
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet info
|
2013-07-25 17:17:32 -04:00
|
|
|
Logger.info(${1:param});
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet warn
|
2013-07-25 17:17:32 -04:00
|
|
|
Logger.warn(${1:param});
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Loops
|
|
|
|
snippet enfor
|
2013-07-25 17:17:32 -04:00
|
|
|
for (${1} : ${2}) ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet for
|
2013-07-25 17:17:32 -04:00
|
|
|
for (${1}; ${2}; ${3}) ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet wh
|
2013-07-25 17:17:32 -04:00
|
|
|
while (${1}) ${0}
|
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-07-25 17:17:32 -04:00
|
|
|
${0}
|
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
|
2013-07-25 17:17:32 -04:00
|
|
|
System.out.print("${0:Message}");
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet printf
|
2013-07-25 17:17:32 -04:00
|
|
|
System.out.printf("${1:Message}", ${0:args});
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet println
|
2013-07-25 17:17:32 -04:00
|
|
|
System.out.println(${0});
|
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
|
2013-07-25 17:17:32 -04:00
|
|
|
render(${1:param});
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet rena
|
2013-07-25 17:17:32 -04:00
|
|
|
renderArgs.put("${1}", ${2});
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet renb
|
2013-07-25 17:17:32 -04:00
|
|
|
renderBinary(${1:param});
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet renj
|
2013-07-25 17:17:32 -04:00
|
|
|
renderJSON(${1:param});
|
2011-06-20 13:40:28 -04:00
|
|
|
snippet renx
|
2013-07-25 17:17:32 -04:00
|
|
|
renderXml(${1:param});
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Setter and Getter Methods
|
|
|
|
snippet set
|
2013-07-25 17:17:32 -04:00
|
|
|
${1:public} void set${3:}(${2:String} ${0:}){
|
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:}(){
|
2013-07-25 17:17:32 -04:00
|
|
|
return this.${0:};
|
2012-01-24 16:52:38 -05:00
|
|
|
}
|
2012-07-02 17:23:32 -04:00
|
|
|
##
|
2012-06-24 15:41:08 -04:00
|
|
|
## Terminate Methods or Loops
|
|
|
|
snippet re
|
2014-06-09 11:34:32 -04:00
|
|
|
return ${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
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 {
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
}
|
|
|
|
snippet test
|
|
|
|
@Test
|
|
|
|
public void test${1:Name}() throws Exception {
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2012-06-24 15:41:08 -04:00
|
|
|
}
|
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
|
2013-07-25 17:17:32 -04:00
|
|
|
public static void ${1:index}(${2:args}) { ${0} }
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet rnf
|
2013-07-25 17:17:32 -04:00
|
|
|
notFound(${1:param});
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet rnfin
|
2013-07-25 17:17:32 -04:00
|
|
|
notFoundIfNull(${1:param});
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet rr
|
2013-07-25 17:17:32 -04:00
|
|
|
redirect(${1:param});
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet ru
|
2013-07-25 17:17:32 -04:00
|
|
|
unauthorized(${1:param});
|
2012-06-24 15:41:08 -04:00
|
|
|
snippet unless
|
2013-07-25 17:17:32 -04:00
|
|
|
(unless=${1:param});
|