-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathuser.xml
14 lines (14 loc) · 1.1 KB
/
user.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<templateSet group="user">
<template name="sing" value="private static $className$ instance; private $className$() {} public static $className$ getInstance() { if (instance == null) { synchronized ($className$.class) { if (instance == null) { instance = new $className$(); } } } return instance; }" description="Creates a Singleton pattern" toReformat="false" toShortenFQNames="true">
<variable name="className" expression="className()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_DECLARATION" value="true" />
</context>
</template>
<template name="const" value="private $className$() { throw new AssertionError(); } " description="Creates a Constants class' constructor" toReformat="false" toShortenFQNames="true">
<variable name="className" expression="className()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_DECLARATION" value="true" />
</context>
</template>
</templateSet>