View Javadoc

1   package com.lexicalscope.jewel.cli.specification;
2   
3   import com.lexicalscope.jewel.cli.ValidationErrorBuilder;
4   
5   import java.util.List;
6   
7   
8   /*
9    * Copyright 2011 Tim Wood
10   *
11   * Licensed under the Apache License, Version 2.0 (the "License");
12   * you may not use this file except in compliance with the License.
13   * You may obtain a copy of the License at
14   *
15   * http://www.apache.org/licenses/LICENSE-2.0
16   *
17   * Unless required by applicable law or agreed to in writing, software
18   * distributed under the License is distributed on an "AS IS" BASIS,
19   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20   * See the License for the specific language governing permissions and
21   * limitations under the License.
22   */
23  
24  public interface ParsedOptionSpecification extends OptionSpecification {
25      /**
26       * Get all of the short names of this option. Short names are single
27       * characters that will by prefixed by the user with "-".
28       *
29       * @return the short names of this option
30       */
31      List<String> getShortNames();
32  
33      /**
34       * All the names of the option
35       *
36       * @return all the names of the option
37       */
38      List<String> getNames();
39  
40      /**
41       * Does this option have a Short Name
42       *
43       * @return true iff the options has a short name
44       */
45      boolean hasShortName();
46  
47      /**
48       * Get the long name of this option. Long names are multiple characters that
49       * will be prefixed by the user with "--".
50       *
51       * @return the long name of this option
52       */
53      List<String> getLongName();
54  
55      /**
56       * The pattern that values must conform to
57       *
58       * @return the regular expression that values must conform to
59       */
60      String getPattern();
61  
62      boolean allowedValue(String value);
63  
64      /**
65       * Does the option take any arguments?
66       *
67       * @return True iff the the option takes at least one argument
68       */
69      boolean hasValue();
70  
71      /**
72       * Is this option a request for help
73       *
74       * @return True iff this option is a request for help
75       */
76      boolean isHelpOption();
77  
78      /**
79       * @return option is a boolean option
80       */
81      boolean isBoolean();
82  
83      void reportMissingTo(ValidationErrorBuilder validationErrorBuilder);
84  }