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