-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathStructureFromTemplateExtension.kt
79 lines (74 loc) · 2.63 KB
/
StructureFromTemplateExtension.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package com.arch.temp.extensions
/**
* Interface defining the structure for template extension callback.
*/
interface StructureFromTemplateExtension {
/**
* Called before creating a template.
*
* @param templateName The name of the template.
* @param templateDescription The description of the template.
* @param selectedPath The path where the template will be created.
* @param pathToTemplate The path to the template.
* @param mapParam Additional parameters for the template creation.
*/
fun onBeforeCreateTemplate(
templateName: String,
templateDescription: String,
selectedPath: String,
pathToTemplate: String,
mapParam: Map<String, String>
)
/**
* Called before creating a file from a template.
*
* @param selectedPath The path where the file will be created.
* @param mapParam Additional parameters for the file creation.
* @param pathToTemplate The path to the template.
* @param pathToTemplateFile The path to the template file.
* @param fileText The text content of the file. All variables are not replaced.
*
* @return The modified text content of the file.
*/
fun onBeforeCreateFile(
selectedPath: String,
mapParam: Map<String, String>,
pathToTemplate: String,
pathToTemplateFile: String,
fileText: String
): String
/**
* Called after creating a file from a template.
*
* @param selectedPath The path where the file was created.
* @param mapParam Additional parameters for the file creation.
* @param pathToTemplate The path to the template.
* @param pathToTemplateFile The path to the template file.
* @param fileText The text content of the file. All variables are already replaced.
*
* @return The modified text content of the file.
*/
fun onAfterCreateFile(
selectedPath: String,
mapParam: Map<String, String>,
pathToTemplate: String,
pathToTemplateFile: String,
fileText: String
): String
/**
* Called after creating a template.
*
* @param templateName The name of the template.
* @param templateDescription The description of the template.
* @param selectedPath The path where the template was created.
* @param pathToTemplate The path to the template.
* @param mapParam Additional parameters for the template creation.
*/
fun onAfterCreateTemplate(
templateName: String,
templateDescription: String,
selectedPath: String,
pathToTemplate: String,
mapParam: Map<String, String>
)
}