View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.0.1 on 2009-09-09 03:30:24,
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.settings;
9   
10  /**
11   * 
12   *         common base class that contains code to track the source
13   * for
14   *         this instance (USER|GLOBAL)
15   *       .
16   * 
17   * @version $Revision$ $Date$
18   */
19  public class TrackableBase
20      implements java.io.Serializable
21  {
22  
23              
24      public static final String USER_LEVEL = "user-level";
25      public static final String GLOBAL_LEVEL = "global-level";
26  
27      private String sourceLevel = USER_LEVEL;
28      private boolean sourceLevelSet = false;
29  
30      public void setSourceLevel( String sourceLevel )
31      {
32          if ( sourceLevelSet )
33          {
34              throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
35          }
36          else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
37          {
38              throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
39          }
40          else
41          {
42              this.sourceLevel = sourceLevel;
43              this.sourceLevelSet = true;
44          }
45      }
46  
47      public String getSourceLevel()
48      {
49          return sourceLevel;
50      }
51              
52            
53  }