This repository was archived by the owner on Mar 4, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +38
-1
lines changed
Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 1+ <templateSet group =" PRTTMPRPHT-JAVA" >
2+ <template name =" sing" value =" public class $FILE_NAME$ { private static $FILE_NAME$ instance; private $FILE_NAME$() {} $END$ public static $FILE_NAME$ get() { if (instance == null) { instance = new $FILE_NAME$(); } return instance; } }" description =" Singleton class" toReformat =" false" toShortenFQNames =" true" >
3+ <variable name =" FILE_NAME" expression =" capitalize(camelCase(fileNameWithoutExtension()))" defaultValue =" " alwaysStopAt =" true" />
4+ <context >
5+ <option name =" COMPLETION" value =" false" />
6+ <option name =" JAVA_CODE" value =" true" />
7+ <option name =" JAVA_COMMENT" value =" false" />
8+ <option name =" JAVA_CONSUMER" value =" false" />
9+ <option name =" JAVA_EXPRESSION" value =" false" />
10+ <option name =" JAVA_STATEMENT" value =" false" />
11+ <option name =" JAVA_STRING" value =" false" />
12+ </context >
13+ </template >
14+ </templateSet >
Original file line number Diff line number Diff line change 11<templateSet group =" PRTTMPRPHT-TS" >
2- <template name =" sing" value =" export class $FILE_NAME$ { private static instance: $FILE_NAME$; private constructor() {} $END$ public static get(): $FILE_NAME$ { if (!$FILE_NAME$.instance) { $FILE_NAME$.instance = new $FILE_NAME$(); } return $FILE_NAME$.instance; } }" description =" Singleton class" toReformat =" false" toShortenFQNames =" true" >
2+ <template name =" sing" value =" export class $FILE_NAME$ { private static instance: $FILE_NAME$; private constructor() {} $END$ public static get(): $FILE_NAME$ { if (!$FILE_NAME$.instance) { $FILE_NAME$.instance = new $FILE_NAME$(); } return $FILE_NAME$.instance; } }" description =" Singleton class" toReformat =" false" toShortenFQNames =" true" >
33 <variable name =" FILE_NAME" expression =" capitalize(camelCase(fileNameWithoutExtension()))" defaultValue =" " alwaysStopAt =" true" />
44 <context >
55 <option name =" TypeScript" value =" true" />
Original file line number Diff line number Diff line change @@ -250,6 +250,29 @@ public final native void set$NAME$(boolean $NAME_LC$)/*-{
250250}-*/;
251251```
252252
253+ ### Java
254+
255+ #### sing
256+
257+ Basic singleton class. Name is derived from the file name.
258+
259+ ```
260+ public class $FILE_NAME$ {
261+ private static $FILE_NAME$ instance;
262+
263+ private $FILE_NAME$() {}
264+
265+ $END$
266+
267+ public static $FILE_NAME$ get() {
268+ if (instance == null) {
269+ instance = new $FILE_NAME$();
270+ }
271+ return instance;
272+ }
273+ }
274+ ```
275+
253276### JavaScript
254277
255278#### clof
You can’t perform that action at this time.
0 commit comments