Coverage Report - com.lexicalscope.jewel.cli.AbstractConvertMethodToOptionSpecification
 
Classes in this File Line Coverage Branch Coverage Complexity
AbstractConvertMethodToOptionSpecification
100%
5/5
N/A
1
 
 1  
 package com.lexicalscope.jewel.cli;
 2  
 
 3  
 import com.lexicalscope.fluentreflection.FluentClass;
 4  
 import com.lexicalscope.fluentreflection.FluentMethod;
 5  
 import com.lexicalscope.jewel.cli.specification.ParsedOptionSpecification;
 6  
 import com.lexicalscope.jewel.cli.specification.UnparsedOptionSpecification;
 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  
 class AbstractConvertMethodToOptionSpecification {
 25  
     protected final FluentClass<?> klass;
 26  
 
 27  580
     public AbstractConvertMethodToOptionSpecification(final FluentClass<?> klass) {
 28  580
         this.klass = klass;
 29  580
     }
 30  
 
 31  
     protected UnparsedOptionSpecification createUnparsedOptionSpecificationFrom(
 32  
             final FluentMethod method) {
 33  
 
 34  60
         return new UnparsedOptionSpecificationImpl(new UnparsedAnnotationAdapter(klass, method, method.annotation(Unparsed.class)));
 35  
     }
 36  
 
 37  
     protected ParsedOptionSpecification createParsedOptionSpecificationFrom(final FluentMethod method) {
 38  514
         return new ParsedOptionSpecificationImpl(new OptionAnnotationAdapter(klass, method));
 39  
     }
 40  
 }