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 package net.sourceforge.plantumldependency.cli.main.option.programminglanguage;
26
27 import static java.util.Collections.unmodifiableSet;
28 import static net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.ProgrammingLanguage.JAVA;
29 import static net.sourceforge.plantumldependency.common.constants.CharacterConstants.SPACE_CHAR;
30 import static net.sourceforge.plantumldependency.commoncli.option.status.OptionStatus.HIDDEN_OPTIONAL_OPTION_STATUS;
31
32 import java.util.Set;
33 import java.util.TreeSet;
34
35 import net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.PlantUMLDependencyProgrammingLanguageOptionArgument;
36 import net.sourceforge.plantumldependency.cli.main.option.programminglanguage.argument.ProgrammingLanguage;
37 import net.sourceforge.plantumldependency.commoncli.command.CommandLine;
38 import net.sourceforge.plantumldependency.commoncli.exception.CommandLineException;
39 import net.sourceforge.plantumldependency.commoncli.option.AbstractOptionWithArgument;
40
41
42
43
44
45
46
47
48
49 public class PlantUMLDependencyProgrammingLanguageOption extends AbstractOptionWithArgument < ProgrammingLanguage > {
50
51
52 private static final long serialVersionUID = 1482556561536453265L;
53
54
55 public static final String OPTION_MAIN_SYNOPSIS = "-l";
56
57
58 public static final Set < String > OPTION_SYNOPSIS = unmodifiableSet(new TreeSet < String >());
59
60
61 public static final ProgrammingLanguage DEFAULT_PROGRAMMING_LANGUAGE = JAVA;
62
63
64
65
66
67
68 public PlantUMLDependencyProgrammingLanguageOption() {
69 super(OPTION_MAIN_SYNOPSIS, OPTION_SYNOPSIS, new PlantUMLDependencyProgrammingLanguageOptionArgument(true),
70 new StringBuilder(
71 "To choose the programming language to reverse engineering. If not specified, the default programming language is \""
72 + DEFAULT_PROGRAMMING_LANGUAGE.getName() + "\"."), SPACE_CHAR,
73 HIDDEN_OPTIONAL_OPTION_STATUS);
74 }
75
76
77
78
79
80
81 @Override
82 public String getDefaultArgumentAsStringIfOptionNotSpecified(final CommandLine commandLine)
83 throws CommandLineException {
84 return DEFAULT_PROGRAMMING_LANGUAGE.getName();
85 }
86
87
88
89
90
91
92 @Override
93 public String getDefaultArgumentAsStringIfOptionSpecified(final CommandLine commandLine)
94 throws CommandLineException {
95 return DEFAULT_PROGRAMMING_LANGUAGE.getName();
96 }
97 }