-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCliBuilder.java
More file actions
77 lines (39 loc) · 1.34 KB
/
CliBuilder.java
File metadata and controls
77 lines (39 loc) · 1.34 KB
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
import InputCommand.ArgStrategy;
import InputCommand.UseSetCurrentDb;
import InputCommand.*;
import minidb.xmlParser.CurrentDBObserver;
import java.util.ArrayList;
public class CliBuilder {
public cli buildCli () {
cli c = new cli();
ArrayList<ArgStrategy> argslist = new ArrayList<>();
ArrayList<UseSetCurrentDb> usedInCurrentDBO = new ArrayList<>();
addArg add = new addArg();
argslist.add(add);
usedInCurrentDBO.add(add);
deleteArg delete = new deleteArg();
argslist.add(delete);
usedInCurrentDBO.add(delete);
readArg read = new readArg();
argslist.add(read);
usedInCurrentDBO.add(read);
schemaArg schema = new schemaArg();
argslist.add(schema);
usedInCurrentDBO.add(schema);
useArg use = new useArg();
argslist.add(use);
// usedInCurrentDBO.add(use);
CurrentDBObserver observer = new CurrentDBObserver(usedInCurrentDBO);
use.setCurrentDBO(observer);
dropArg drop = new dropArg();
argslist.add(drop);
helpArg help = new helpArg();
argslist.add(help);
listArg list = new listArg();
argslist.add(list);
newArg newA = new newArg();
argslist.add(newA);
c.setArgsList(argslist);
return c;
}
}