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.exclude;
26
27 import static java.util.Arrays.asList;
28 import static java.util.Collections.unmodifiableSet;
29 import static net.sourceforge.plantumldependency.cli.constants.PlantUMLDependencyConstants.DEFAULT_EXCLUDE_OPTIONS;
30 import static net.sourceforge.plantumldependency.common.constants.CharacterConstants.SPACE_CHAR;
31 import static net.sourceforge.plantumldependency.commoncli.option.status.OptionStatus.ACTIVE_OPTIONAL_OPTION_STATUS;
32
33 import java.util.Set;
34 import java.util.TreeSet;
35
36 import net.sourceforge.plantumldependency.commoncli.command.CommandLine;
37 import net.sourceforge.plantumldependency.commoncli.exception.CommandLineException;
38 import net.sourceforge.plantumldependency.commoncli.option.AbstractOptionWithArgument;
39 import net.sourceforge.plantumldependency.commoncli.option.argument.impl.filepattern.ExcludeFilePatternOptionArgumentImpl;
40
41 import org.apache.tools.ant.types.FileSet;
42
43
44
45
46
47
48
49
50
51 public class PlantUMLDependencyExcludeOption extends AbstractOptionWithArgument < FileSet > {
52
53
54 private static final long serialVersionUID = -4187623575754105884L;
55
56
57 public static final String OPTION_MAIN_SYNOPSIS = "-e";
58
59
60 public static final Set < String > OPTION_SYNOPSIS = unmodifiableSet(new TreeSet < String >(
61 asList(new String[] {"--exclude"})));
62
63
64
65
66
67
68 public PlantUMLDependencyExcludeOption() {
69 super(OPTION_MAIN_SYNOPSIS, OPTION_SYNOPSIS, new ExcludeFilePatternOptionArgumentImpl(true), new StringBuilder(
70 "To exclude files that match the provided pattern. If not specified, the default pattern is \""
71 + DEFAULT_EXCLUDE_OPTIONS + "\"."), SPACE_CHAR, ACTIVE_OPTIONAL_OPTION_STATUS);
72 }
73
74
75
76
77
78
79 @Override
80 public String getDefaultArgumentAsStringIfOptionNotSpecified(final CommandLine commandLine)
81 throws CommandLineException {
82 return DEFAULT_EXCLUDE_OPTIONS;
83 }
84
85
86
87
88
89
90 @Override
91 public String getDefaultArgumentAsStringIfOptionSpecified(final CommandLine commandLine)
92 throws CommandLineException {
93 return DEFAULT_EXCLUDE_OPTIONS;
94 }
95 }