123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- ace.define("ace/snippets/java",[], function(require, exports, module) {
- "use strict";
- exports.snippetText = "## Access Modifiers\n\
- snippet po\n\
- protected\n\
- snippet pu\n\
- public\n\
- snippet pr\n\
- private\n\
- ##\n\
- ## Annotations\n\
- snippet before\n\
- @Before\n\
- static void ${1:intercept}(${2:args}) { ${3} }\n\
- snippet mm\n\
- @ManyToMany\n\
- ${1}\n\
- snippet mo\n\
- @ManyToOne\n\
- ${1}\n\
- snippet om\n\
- @OneToMany${1:(cascade=CascadeType.ALL)}\n\
- ${2}\n\
- snippet oo\n\
- @OneToOne\n\
- ${1}\n\
- ##\n\
- ## Basic Java packages and import\n\
- snippet im\n\
- import\n\
- snippet j.b\n\
- java.beans.\n\
- snippet j.i\n\
- java.io.\n\
- snippet j.m\n\
- java.math.\n\
- snippet j.n\n\
- java.net.\n\
- snippet j.u\n\
- java.util.\n\
- ##\n\
- ## Class\n\
- snippet cl\n\
- class ${1:`Filename(\"\", \"untitled\")`} ${2}\n\
- snippet in\n\
- interface ${1:`Filename(\"\", \"untitled\")`} ${2:extends Parent}${3}\n\
- snippet tc\n\
- public class ${1:`Filename()`} extends ${2:TestCase}\n\
- ##\n\
- ## Class Enhancements\n\
- snippet ext\n\
- extends \n\
- snippet imp\n\
- implements\n\
- ##\n\
- ## Comments\n\
- snippet /*\n\
- /*\n\
- * ${1}\n\
- */\n\
- ##\n\
- ## Constants\n\
- snippet co\n\
- static public final ${1:String} ${2:var} = ${3};${4}\n\
- snippet cos\n\
- static public final String ${1:var} = \"${2}\";${3}\n\
- ##\n\
- ## Control Statements\n\
- snippet case\n\
- case ${1}:\n\
- ${2}\n\
- snippet def\n\
- default:\n\
- ${2}\n\
- snippet el\n\
- else\n\
- snippet elif\n\
- else if (${1}) ${2}\n\
- snippet if\n\
- if (${1}) ${2}\n\
- snippet sw\n\
- switch (${1}) {\n\
- ${2}\n\
- }\n\
- ##\n\
- ## Create a Method\n\
- snippet m\n\
- ${1:void} ${2:method}(${3}) ${4:throws }${5}\n\
- ##\n\
- ## Create a Variable\n\
- snippet v\n\
- ${1:String} ${2:var}${3: = null}${4};${5}\n\
- ##\n\
- ## Enhancements to Methods, variables, classes, etc.\n\
- snippet ab\n\
- abstract\n\
- snippet fi\n\
- final\n\
- snippet st\n\
- static\n\
- snippet sy\n\
- synchronized\n\
- ##\n\
- ## Error Methods\n\
- snippet err\n\
- System.err.print(\"${1:Message}\");\n\
- snippet errf\n\
- System.err.printf(\"${1:Message}\", ${2:exception});\n\
- snippet errln\n\
- System.err.println(\"${1:Message}\");\n\
- ##\n\
- ## Exception Handling\n\
- snippet as\n\
- assert ${1:test} : \"${2:Failure message}\";${3}\n\
- snippet ca\n\
- catch(${1:Exception} ${2:e}) ${3}\n\
- snippet thr\n\
- throw\n\
- snippet ths\n\
- throws\n\
- snippet try\n\
- try {\n\
- ${3}\n\
- } catch(${1:Exception} ${2:e}) {\n\
- }\n\
- snippet tryf\n\
- try {\n\
- ${3}\n\
- } catch(${1:Exception} ${2:e}) {\n\
- } finally {\n\
- }\n\
- ##\n\
- ## Find Methods\n\
- snippet findall\n\
- List<${1:listName}> ${2:items} = ${1}.findAll();${3}\n\
- snippet findbyid\n\
- ${1:var} ${2:item} = ${1}.findById(${3});${4}\n\
- ##\n\
- ## Javadocs\n\
- snippet /**\n\
- /**\n\
- * ${1}\n\
- */\n\
- snippet @au\n\
- @author `system(\"grep \\`id -un\\` /etc/passwd | cut -d \\\":\\\" -f5 | cut -d \\\",\\\" -f1\")`\n\
- snippet @br\n\
- @brief ${1:Description}\n\
- snippet @fi\n\
- @file ${1:`Filename()`}.java\n\
- snippet @pa\n\
- @param ${1:param}\n\
- snippet @re\n\
- @return ${1:param}\n\
- ##\n\
- ## Logger Methods\n\
- snippet debug\n\
- Logger.debug(${1:param});${2}\n\
- snippet error\n\
- Logger.error(${1:param});${2}\n\
- snippet info\n\
- Logger.info(${1:param});${2}\n\
- snippet warn\n\
- Logger.warn(${1:param});${2}\n\
- ##\n\
- ## Loops\n\
- snippet enfor\n\
- for (${1} : ${2}) ${3}\n\
- snippet for\n\
- for (${1}; ${2}; ${3}) ${4}\n\
- snippet wh\n\
- while (${1}) ${2}\n\
- ##\n\
- ## Main method\n\
- snippet main\n\
- public static void main (String[] args) {\n\
- ${1:/* code */}\n\
- }\n\
- ##\n\
- ## Print Methods\n\
- snippet print\n\
- System.out.print(\"${1:Message}\");\n\
- snippet printf\n\
- System.out.printf(\"${1:Message}\", ${2:args});\n\
- snippet println\n\
- System.out.println(${1});\n\
- ##\n\
- ## Render Methods\n\
- snippet ren\n\
- render(${1:param});${2}\n\
- snippet rena\n\
- renderArgs.put(\"${1}\", ${2});${3}\n\
- snippet renb\n\
- renderBinary(${1:param});${2}\n\
- snippet renj\n\
- renderJSON(${1:param});${2}\n\
- snippet renx\n\
- renderXml(${1:param});${2}\n\
- ##\n\
- ## Setter and Getter Methods\n\
- snippet set\n\
- ${1:public} void set${3:}(${2:String} ${4:}){\n\
- this.$4 = $4;\n\
- }\n\
- snippet get\n\
- ${1:public} ${2:String} get${3:}(){\n\
- return this.${4:};\n\
- }\n\
- ##\n\
- ## Terminate Methods or Loops\n\
- snippet re\n\
- return\n\
- snippet br\n\
- break;\n\
- ##\n\
- ## Test Methods\n\
- snippet t\n\
- public void test${1:Name}() throws Exception {\n\
- ${2}\n\
- }\n\
- snippet test\n\
- @Test\n\
- public void test${1:Name}() throws Exception {\n\
- ${2}\n\
- }\n\
- ##\n\
- ## Utils\n\
- snippet Sc\n\
- Scanner\n\
- ##\n\
- ## Miscellaneous\n\
- snippet action\n\
- public static void ${1:index}(${2:args}) { ${3} }\n\
- snippet rnf\n\
- notFound(${1:param});${2}\n\
- snippet rnfin\n\
- notFoundIfNull(${1:param});${2}\n\
- snippet rr\n\
- redirect(${1:param});${2}\n\
- snippet ru\n\
- unauthorized(${1:param});${2}\n\
- snippet unless\n\
- (unless=${1:param});${2}\n\
- ";
- exports.scope = "java";
- });
- (function() {
- ace.require(["ace/snippets/java"], function(m) {
- if (typeof module == "object" && typeof exports == "object" && module) {
- module.exports = m;
- }
- });
- })();
-
|