mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
192 lines
17 KiB
XML
192 lines
17 KiB
XML
<template name="addX" value="/******************************************************************************* ** *******************************************************************************/ public void add$TYPE$($TYPE$ $var$) { if(this.$list$ == null) { this.$list$ = new ArrayList<>(); } this.$list$.add($var$); }" description="write a method to add an X to a list" toReformat="false" toShortenFQNames="true">
|
|
<variable name="TYPE" expression="className()" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="var" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="list" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="afterAllMethod" value="/******************************************************************************* ** *******************************************************************************/ @AfterAll static void afterAll() { $END$ } " description="Write a junt afterAll method" toReformat="true" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="afterEachMethod" value="/******************************************************************************* ** *******************************************************************************/ @AfterEach void afterEach() { $END$ } " description="Write a junt afterEach method" toReformat="true" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="beforeAllMethod" value="/******************************************************************************* ** *******************************************************************************/ @BeforeAll static void beforeAll() { $END$ } " description="Write a junt beforeAll method" toReformat="true" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="beforeAndAfterEachMethod" value="/******************************************************************************* ** *******************************************************************************/ @BeforeEach @AfterEach void beforeAndAfterEach() { $END$ } " description="Write a junt beforeAndAfterEach method" toReformat="true" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="beforeEachMethod" value="/******************************************************************************* ** *******************************************************************************/ @BeforeEach void beforeEach() { $END$ } " description="Write a junt beforeEach method" toReformat="true" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="gs" value=" /******************************************************************************* ** Getter for $field$ ** *******************************************************************************/ public $fieldType$ get$fieldUcFirst$() { return $field$; } /******************************************************************************* ** Setter for $field$ ** *******************************************************************************/ public void set$fieldUcFirst$($fieldType$ $field$) { this.$field$ = $field$; } " description="Write a getter and setter" toReformat="false" toShortenFQNames="true">
|
|
<variable name="field" expression="completeSmart()" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="fieldUcFirst" expression="capitalize(field)" defaultValue="" alwaysStopAt="false" />
|
|
<variable name="fieldType" expression="typeOfVariable(field)" defaultValue="" alwaysStopAt="false" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="gsw" value=" /******************************************************************************* ** Getter for $field$ ** *******************************************************************************/ public $fieldType$ get$fieldUcFirst$() { return $field$; } /******************************************************************************* ** Setter for $field$ ** *******************************************************************************/ public void set$fieldUcFirst$($fieldType$ $field$) { this.$field$ = $field$; } /******************************************************************************* ** Fluent setter for $field$ ** *******************************************************************************/ public $thisClass$ with$fieldUcFirst$($fieldType$ $field$) { this.$field$ = $field$; return (this); } " description="Write a getter, setter, and fluent setter" toReformat="false" toShortenFQNames="true">
|
|
<variable name="field" expression="completeSmart()" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="thisClass" expression="className()" defaultValue="" alwaysStopAt="false" />
|
|
<variable name="fieldUcFirst" expression="capitalize(field)" defaultValue="" alwaysStopAt="false" />
|
|
<variable name="fieldType" expression="typeOfVariable(field)" defaultValue="" alwaysStopAt="false" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="innerclass" value="/******************************************************************************* ** *******************************************************************************/ $ACCESS$ static class $NAME$ { $END$ }" description="Write an inner class" toReformat="true" toShortenFQNames="true">
|
|
<variable name="ACCESS" expression="enum("public", "private", "protected")" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="NAME" expression="" defaultValue=""Foo"" alwaysStopAt="true" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="javadoc" value="/******************************************************************************* ** $END$ *******************************************************************************/" description="Write a method or class header javadoc comment" toReformat="false" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="list" value="List<$TYPE$> $var$ = new ArrayList<>();" description="List<T> list = new ArrayList<>();" toReformat="false" toShortenFQNames="true">
|
|
<variable name="TYPE" expression="className()" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="var" expression="completeSmart()" defaultValue="" alwaysStopAt="true" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
<option name="JAVA_STATEMENT" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="main" value="/******************************************************************************* ** *******************************************************************************/ public static void main(String[] args) { $CLASS$ instance = new $CLASS$(); instance.run(); } /******************************************************************************* ** *******************************************************************************/ public void run() { try { $END$ } catch(Exception e) { e.printStackTrace(); } }" description="Write a main method (which will instantiate the current class and call a new run() method)" toReformat="true" toShortenFQNames="true">
|
|
<variable name="CLASS" expression="fileNameWithoutExtension()" defaultValue="" alwaysStopAt="false" />
|
|
<context>
|
|
<option name="COMPLETION" value="false" />
|
|
<option name="JAVA_CODE" value="true" />
|
|
<option name="JAVA_COMMENT" value="false" />
|
|
<option name="JAVA_EXPRESSION" value="false" />
|
|
<option name="JAVA_STATEMENT" value="false" />
|
|
<option name="JAVA_STRING" value="false" />
|
|
</context>
|
|
</template>
|
|
<template name="map" value="Map<$KEY$, $VALUE$> $var$ = new HashMap<>();" description="Map<K,V> m = new HashMap<>();" toReformat="false" toShortenFQNames="true">
|
|
<variable name="KEY" expression="className()" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="VALUE" expression="className()" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="var" expression="completeSmart()" defaultValue="" alwaysStopAt="true" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
<option name="JAVA_STATEMENT" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="method" value="/******************************************************************************* ** *******************************************************************************/ $ACCESS$ $TYPE$ $NAME$($ARGS$) { $TYPE$ rs = new $TYPE$(); $END$ return(rs); }" description="Write a method (that returns something)" toReformat="true" toShortenFQNames="true">
|
|
<variable name="ACCESS" expression="enum("public", "private", "protected")" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="TYPE" expression="" defaultValue=""Object"" alwaysStopAt="true" />
|
|
<variable name="NAME" expression="" defaultValue=""foo"" alwaysStopAt="true" />
|
|
<variable name="ARGS" expression="" defaultValue="" alwaysStopAt="true" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="methodVoid" value="/******************************************************************************* ** *******************************************************************************/ $ACCESS$ void $NAME$($ARGS$) { $END$ }" description="Write a method (that returns void)" toReformat="false" toShortenFQNames="true">
|
|
<variable name="ACCESS" expression="enum("public", "private", "protected")" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="NAME" expression="" defaultValue=""foo"" alwaysStopAt="true" />
|
|
<variable name="ARGS" expression="" defaultValue="" alwaysStopAt="true" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="new" value="$TYPE$ $INSTANCE$ = new $TYPE$($END$);" description="Create new instance" toReformat="false" toShortenFQNames="true">
|
|
<variable name="TYPE" expression="" defaultValue=""Object"" alwaysStopAt="true" />
|
|
<variable name="INSTANCE" expression="camelCase(TYPE)" defaultValue="" alwaysStopAt="true" />
|
|
<context>
|
|
<option name="JAVA_STATEMENT" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="newal" value="new ArrayList<>()" description="new ArrayList<>()" toReformat="false" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_EXPRESSION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="newhm" value="new HashMap<>()" description="new HashMap<>()" toReformat="false" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_EXPRESSION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="newhs" value="new HashSet<>()" description="new LinkedList<>()" toReformat="false" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_EXPRESSION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="newlh" value="new ListingHash<>()" description="new ListingHash<>()" toReformat="false" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_EXPRESSION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="newlhm" value="new LinkedHashMap<>()" description="new LinkedHashMap<>()" toReformat="false" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_EXPRESSION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="newll" value="new LinkedList<>()" description="new LinkedList<>()" toReformat="false" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_EXPRESSION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="set" value="Set<$TYPE$> $var$ = new HashSet<>();" description="Set<T> s = new HashSet<>();" toReformat="false" toShortenFQNames="true">
|
|
<variable name="TYPE" expression="" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="var" expression="completeSmart()" defaultValue="" alwaysStopAt="true" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
<option name="JAVA_STATEMENT" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="singleton" value="private static $CLASS_NAME$ $INSTANCE$ = null; /******************************************************************************* ** Singleton constructor *******************************************************************************/ private $CLASS_NAME$() { } /******************************************************************************* ** Singleton accessor *******************************************************************************/ public static $CLASS_NAME$ getInstance() { if($INSTANCE$ == null) { $INSTANCE$ = new $CLASS_NAME$(); } return ($INSTANCE$); } " description="Create a singleton field, constructor, and accessor" toReformat="false" toShortenFQNames="true">
|
|
<variable name="CLASS_NAME" expression="className()" defaultValue="" alwaysStopAt="false" />
|
|
<variable name="INSTANCE" expression="decapitalize(className())" defaultValue="" alwaysStopAt="false" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="tcp" value="try { $END$ } catch(Exception e) { e.printStackTrace(); }" description="try { } catch(Exception e) { e.printStackTrace() }" toReformat="false" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_STATEMENT" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="tcpr" value="try { $END$ } catch(Exception e) { e.printStackTrace(); throw(e); }" description="try { } catch(Exception e) { e.printStackTrace(); throw(e); }" toReformat="false" toShortenFQNames="true">
|
|
<context>
|
|
<option name="JAVA_STATEMENT" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="tct" value="try { $END$ } catch(Exception e) { throw(new $THROW$("$MESSAGE$", e)); }" description="try { } catch(Exception e) { throw(new Exception("", e); }" toReformat="false" toShortenFQNames="true">
|
|
<variable name="THROW" expression="expectedType()" defaultValue=""Exception"" alwaysStopAt="true" />
|
|
<variable name="MESSAGE" expression="" defaultValue=""Error"" alwaysStopAt="true" />
|
|
<context>
|
|
<option name="JAVA_STATEMENT" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="testMethod" value="/******************************************************************************* ** *******************************************************************************/ @Test void test$NAME_SUFFIX$() { $END$ } " description="Write a test method" toReformat="true" toShortenFQNames="true">
|
|
<variable name="NAME_SUFFIX" expression="" defaultValue="" alwaysStopAt="true" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|
|
<template name="with" value="/******************************************************************************* ** Fluent setter for $field$ ** *******************************************************************************/ public $thisClass$ with$fieldUcFirst$($fieldType$ $field$) { set$fieldUcFirst$($field$); return (this); } " description="Write a fluent setter" toReformat="false" toShortenFQNames="true">
|
|
<variable name="field" expression="" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="thisClass" expression="className()" defaultValue="" alwaysStopAt="false" />
|
|
<variable name="fieldUcFirst" expression="capitalize(field)" defaultValue="" alwaysStopAt="false" />
|
|
<variable name="fieldType" expression="typeOfVariable(field)" defaultValue="" alwaysStopAt="false" />
|
|
<context>
|
|
<option name="JAVA_DECLARATION" value="true" />
|
|
</context>
|
|
</template>
|