Coverage Report - org.codehaus.plexus.interpolation.FixedInterpolatorValueSource
 
Classes in this File Line Coverage Branch Coverage Complexity
FixedInterpolatorValueSource
62%
5/8
N/A
1
 
 1  
 package org.codehaus.plexus.interpolation;
 2  
 
 3  
 import org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator;
 4  
 import org.codehaus.plexus.interpolation.fixed.InterpolationState;
 5  
 
 6  
 import java.util.List;
 7  
 
 8  
 /**
 9  
  * A value source that allows a fixed interpolator to be injected into
 10  
  * a regular interpolator. This value source encapsulates state, so even though
 11  
  * the fixed interpolator can be used as a singleton, a single FixedInterpolatorValueSource
 12  
  * can only belong to one interpolator any given time.
 13  
  */
 14  
 public class FixedInterpolatorValueSource implements ValueSource
 15  
 
 16  
 {
 17  
     private final FixedStringSearchInterpolator fixedStringSearchInterpolator;
 18  1
     private final InterpolationState errorCollector = new InterpolationState();
 19  
 
 20  
     public FixedInterpolatorValueSource( FixedStringSearchInterpolator fixedStringSearchInterpolator )
 21  1
     {
 22  1
         this.fixedStringSearchInterpolator = fixedStringSearchInterpolator;
 23  1
     }
 24  
 
 25  
     public Object getValue( String expression )
 26  
     {
 27  1
        return fixedStringSearchInterpolator.getValue( expression, errorCollector  );
 28  
     }
 29  
 
 30  
     public List getFeedback()
 31  
     {
 32  0
         return errorCollector.asList();
 33  
     }
 34  
 
 35  
     public void clearFeedback()
 36  
     {
 37  0
         errorCollector.clear();
 38  
 
 39  0
     }
 40  
 }