Coverage Report - uk.co.badgersinfoil.asxsd.components.IdentityMappingFunction
 
Classes in this File Line Coverage Branch Coverage Complexity
IdentityMappingFunction
67% 
N/A 
1
 
 1  
 package uk.co.badgersinfoil.asxsd.components;
 2  
 
 3  
 import uk.co.badgersinfoil.asxsd.MappingFunction;
 4  
 import uk.co.badgersinfoil.metaas.dom.ASMethod;
 5  
 
 6  
 /**
 7  
  * A 'mapping function' interface implementation that actually contributes
 8  
  * no code toward the generated program (when applied to an expression, the
 9  
  * expression is unchanged).
 10  
  */
 11  
 public class IdentityMappingFunction implements MappingFunction {
 12  
         
 13  1
         public static IdentityMappingFunction INSTANCE = new IdentityMappingFunction();
 14  
         
 15  1
         private IdentityMappingFunction() {
 16  
                 // hide ctor
 17  1
         }
 18  
 
 19  
         /**
 20  
          * Returns its argument unchanged.
 21  
          */
 22  
         public String appliedTo(String expr) {
 23  84
                 return expr;
 24  
         }
 25  
 
 26  
         /**
 27  
          * Always returns null.
 28  
          */
 29  
         public ASMethod getImplementation() {
 30  0
                 return null;
 31  
         }
 32  
         public void setImplementation(ASMethod impl) {
 33  
                 // no-op
 34  0
         }
 35  
 }