Coverage Report - org.apache.maven.settings.TrackableBase
 
Classes in this File Line Coverage Branch Coverage Complexity
TrackableBase
0%
0/15
0%
0/6
2
 
 1  
 /*
 2  
  * $Id$
 3  
  */
 4  
 
 5  
 package org.apache.maven.settings;
 6  
 
 7  
   //---------------------------------/
 8  
  //- Imported classes and packages -/
 9  
 //---------------------------------/
 10  
 
 11  
 import java.util.Date;
 12  
 
 13  
 /**
 14  
  * 
 15  
  *         common base class that contains code to track the source
 16  
  * for
 17  
  *         this instance (USER|GLOBAL)
 18  
  *       .
 19  
  * 
 20  
  * @version $Revision$ $Date$
 21  
  */
 22  0
 public class TrackableBase implements java.io.Serializable {
 23  
 
 24  
 
 25  
             
 26  
     public static final String USER_LEVEL = "user-level";
 27  
     public static final String GLOBAL_LEVEL = "global-level";
 28  
 
 29  0
     private String sourceLevel = USER_LEVEL;
 30  0
     private boolean sourceLevelSet = false;
 31  
 
 32  
     public void setSourceLevel( String sourceLevel )
 33  
     {
 34  0
         if ( sourceLevelSet )
 35  
         {
 36  0
             throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
 37  
         }
 38  0
         else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
 39  
         {
 40  0
             throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
 41  
         }
 42  
         else
 43  
         {
 44  0
             this.sourceLevel = sourceLevel;
 45  0
             this.sourceLevelSet = true;
 46  
         }
 47  0
     }
 48  
 
 49  
     public String getSourceLevel()
 50  
     {
 51  0
         return sourceLevel;
 52  
     }
 53  
             
 54  
           
 55  0
     private String modelEncoding = "UTF-8";
 56  
 
 57  
     /**
 58  
      * Set an encoding used for reading/writing the model.
 59  
      *
 60  
      * @param modelEncoding the encoding used when reading/writing the model.
 61  
      */
 62  
     public void setModelEncoding( String modelEncoding )
 63  
     {
 64  0
         this.modelEncoding = modelEncoding;
 65  0
     }
 66  
 
 67  
     /**
 68  
      * @return the current encoding used when reading/writing this model.
 69  
      */
 70  
     public String getModelEncoding()
 71  
     {
 72  0
         return modelEncoding;
 73  
     }
 74  
 }