|
1 | 1 | package samplecode.args; |
2 | 2 |
|
3 | 3 |
|
4 | | -import com.unboundid.util.args.ArgumentException; |
5 | | -import com.unboundid.util.args.StringArgument; |
6 | | - |
| 4 | +import com.unboundid.util.args.*; |
7 | 5 | import java.util.ResourceBundle; |
8 | 6 |
|
9 | 7 |
|
|
12 | 10 | * {@link String} |
13 | 11 | */ |
14 | 12 | public class StringPropertiesBackedArgument |
15 | | - extends PropertiesBackedArgument<StringArgument,String> { |
16 | | - |
17 | | - |
18 | | - /** |
19 | | - * @param resourceBundle |
20 | | - * the resource bundle from which the command line argument |
21 | | - * are taken |
22 | | - * @param basePropertyName |
23 | | - * the base property name |
24 | | - * |
25 | | - * @return a new {@code StringPropertiesBackedArgument} object. |
26 | | - */ |
27 | | - public static StringPropertiesBackedArgument newStringPropertiesBackedArgument( |
28 | | - final ResourceBundle resourceBundle, final String basePropertyName) { |
29 | | - return new StringPropertiesBackedArgument(resourceBundle,basePropertyName); |
30 | | - } |
31 | | - |
32 | | - |
33 | | - |
34 | | - @Override |
35 | | - public StringArgument getArgument() throws ArgumentException { |
36 | | - return new StringArgument(getShortIdentifier(),getLongIdentifier(),isRequired(), |
37 | | - getMaxOccurrences(),getValuePlaceholder(),getDescription(),getDefaultValue()); |
38 | | - } |
39 | | - |
40 | | - |
41 | | - |
42 | | - @Override |
43 | | - protected String convertString(final String value) { |
44 | | - return value; |
45 | | - } |
46 | | - |
47 | | - |
48 | | - |
49 | | - private StringPropertiesBackedArgument( |
50 | | - final ResourceBundle resourceBundle, final String basePropertyName) { |
51 | | - super(resourceBundle,basePropertyName); |
52 | | - } |
| 13 | + extends PropertiesBackedArgument<StringArgument,String> |
| 14 | +{ |
| 15 | + |
| 16 | + /** |
| 17 | + * @param resourceBundle |
| 18 | + * the resource bundle from which the command line argument |
| 19 | + * are taken |
| 20 | + * @param basePropertyName |
| 21 | + * the base property name |
| 22 | + * |
| 23 | + * @return a new {@code StringPropertiesBackedArgument} object. |
| 24 | + */ |
| 25 | + public static StringPropertiesBackedArgument newStringPropertiesBackedArgument( |
| 26 | + final ResourceBundle resourceBundle,final String basePropertyName) |
| 27 | + { |
| 28 | + return new StringPropertiesBackedArgument(resourceBundle,basePropertyName); |
| 29 | + } |
| 30 | + |
| 31 | + |
| 32 | + private StringPropertiesBackedArgument( |
| 33 | + final ResourceBundle resourceBundle,final String basePropertyName) |
| 34 | + { |
| 35 | + super(resourceBundle,basePropertyName); |
| 36 | + } |
| 37 | + |
| 38 | + |
| 39 | + @Override |
| 40 | + protected String convertString(final String value) |
| 41 | + { |
| 42 | + return value; |
| 43 | + } |
| 44 | + |
| 45 | + |
| 46 | + @Override |
| 47 | + public StringArgument getArgument() throws ArgumentException |
| 48 | + { |
| 49 | + return new StringArgument(getShortIdentifier(),getLongIdentifier(),isRequired(), |
| 50 | + getMaxOccurrences(),getValuePlaceholder(),getDescription(), |
| 51 | + getDefaultValue()); |
| 52 | + } |
53 | 53 |
|
54 | 54 |
|
55 | 55 | } |
0 commit comments