View Javadoc

1   package com.lexicalscope.jewel.cli;
2   
3   import com.lexicalscope.fluentreflection.FluentClass;
4   import com.lexicalscope.fluentreflection.FluentMethod;
5   
6   /*
7    * Copyright 2011 Tim Wood
8    *
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   *
13   * http://www.apache.org/licenses/LICENSE-2.0
14   *
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   */
21  
22  final class UnparsedAnnotationAdapter extends AbstractOptionAdapter {
23      private final Unparsed option;
24  
25      UnparsedAnnotationAdapter(
26              final FluentClass<?> klass,
27              final FluentMethod method,
28              final Unparsed unparsed) {
29          super(klass, method);
30          this.option = unparsed;
31      }
32  
33      @Override public String description() {
34          return option.description().trim();
35      }
36  
37      @Override public String pattern() {
38          return option.pattern();
39      }
40  
41      @Override public boolean defaultToNull() {
42          return option.defaultToNull();
43      }
44  
45      @Override public String[] defaultValue() {
46          return option.defaultValue();
47      }
48  
49      public String name() {
50          return option.name();
51      }
52  
53      @Override public boolean isHidden() {
54          return option.hidden();
55      }
56  
57      @Override public int minimum() {
58          return option.minimum();
59      }
60  
61      @Override public int exactly() {
62          return option.exactly();
63      }
64  
65      @Override public int maximum() {
66          return option.maximum();
67      }
68  }