-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAbstractProgramCode.java
98 lines (71 loc) · 2.48 KB
/
AbstractProgramCode.java
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package tw.yukina.dcdos.program;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import java.util.HashMap;
import java.util.Map;
public abstract class AbstractProgramCode {
@Getter
@Setter
private boolean isDisable = false;
@Getter
@Setter
private boolean displayHeader = true;
@Autowired
protected ApplicationContext applicationContext;
protected ProgramController programController;
public String getFullName(){
return getNamespace() + "." + getName();
}
public void setProgramController(ProgramController programController){
if(this.programController == null)this.programController = programController;
}
protected void call(String fullName){
programController.call(fullName);
}
protected void callByKeyWord(String keyWord){
programController.callByKeyWord(keyWord);
}
protected void fork(String fullName){
programController.fork(fullName);
}
protected void forkByKeyWord(String keyWord){
programController.forkByKeyWord(keyWord);
}
protected void stdout(Map<String, Object> messageWithOption){
programController.putStdout(messageWithOption);
}
protected void stdout(String message, Map<String, Object> option){
option.put("Message", message);
programController.putStdout(option);
}
protected void stdout(String message){
programController.putStdoutMessage(message);
}
protected void stdout(String message, String uuid){
programController.putStdoutMessage(message, uuid);
}
protected void stderr(String message){
programController.putStderr(message);
}
protected void updateStdout(Map<String, Object> messageMap){
programController.putUpdateStdout(messageMap);
}
protected void updateStdout(String message, String uuid){
programController.putUpdateStdout(message, uuid);
}
protected String getInput(){
return programController.getInput();
}
protected Map<String, Object> getOption(String key, Object value){
Map<String, Object> option = new HashMap<>();
option.put(key, value);
return option;
}
public abstract String[] getKeyword();
public abstract String getName();
public abstract String getNamespace();
public abstract String getDepiction();
public abstract void run();
}