View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.11,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.settings;
7   
8   /**
9    * 
10   *         common base class that contains code to track the source
11   * for
12   *         this instance (USER|GLOBAL)
13   *       .
14   * 
15   * @version $Revision$ $Date$
16   */
17  @SuppressWarnings( "all" )
18  public class TrackableBase
19      implements java.io.Serializable, java.lang.Cloneable
20  {
21  
22        //-----------/
23       //- Methods -/
24      //-----------/
25  
26      /**
27       * Method clone.
28       * 
29       * @return TrackableBase
30       */
31      public TrackableBase clone()
32      {
33          try
34          {
35              TrackableBase copy = (TrackableBase) super.clone();
36  
37              return copy;
38          }
39          catch ( java.lang.Exception ex )
40          {
41              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
42                  + " does not support clone()" ).initCause( ex );
43          }
44      } //-- TrackableBase clone()
45  
46      
47              
48      public static final String USER_LEVEL = "user-level";
49      public static final String GLOBAL_LEVEL = "global-level";
50  
51      private String sourceLevel = USER_LEVEL;
52      private boolean sourceLevelSet = false;
53  
54      public void setSourceLevel( String sourceLevel )
55      {
56          if ( sourceLevelSet )
57          {
58              throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
59          }
60          else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
61          {
62              throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
63          }
64          else
65          {
66              this.sourceLevel = sourceLevel;
67              this.sourceLevelSet = true;
68          }
69      }
70  
71      public String getSourceLevel()
72      {
73          return sourceLevel;
74      }
75              
76            
77  }