View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.4.1 on 2013-02-24 03:31:03,
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  @SuppressWarnings( "all" )
20  public class TrackableBase
21      implements java.io.Serializable, java.lang.Cloneable
22  {
23  
24        //-----------/
25       //- Methods -/
26      //-----------/
27  
28      /**
29       * Method clone.
30       * 
31       * @return TrackableBase
32       */
33      public TrackableBase clone()
34      {
35          try
36          {
37              TrackableBase copy = (TrackableBase) super.clone();
38  
39              return copy;
40          }
41          catch ( java.lang.Exception ex )
42          {
43              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
44                  + " does not support clone()" ).initCause( ex );
45          }
46      } //-- TrackableBase clone()
47  
48      
49              
50      public static final String USER_LEVEL = "user-level";
51      public static final String GLOBAL_LEVEL = "global-level";
52  
53      private String sourceLevel = USER_LEVEL;
54      private boolean sourceLevelSet = false;
55  
56      public void setSourceLevel( String sourceLevel )
57      {
58          if ( sourceLevelSet )
59          {
60              throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
61          }
62          else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
63          {
64              throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
65          }
66          else
67          {
68              this.sourceLevel = sourceLevel;
69              this.sourceLevelSet = true;
70          }
71      }
72  
73      public String getSourceLevel()
74      {
75          return sourceLevel;
76      }
77              
78            
79  }