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.plugin.registry;
9   
10  /**
11   * common base class that contains code to track the source for
12   * this instance (USER|GLOBAL).
13   * 
14   * @version $Revision$ $Date$
15   */
16  public class TrackableBase
17      implements java.io.Serializable
18  {
19  
20      public static final String USER_LEVEL = "user-level";
21      public static final String GLOBAL_LEVEL = "global-level";
22  
23      private String sourceLevel = USER_LEVEL;
24      private boolean sourceLevelSet = false;
25  
26      public void setSourceLevel( String sourceLevel )
27      {
28          if ( sourceLevelSet )
29          {
30              throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
31          }
32          else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
33          {
34              throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
35          }
36          else
37          {
38              this.sourceLevel = sourceLevel;
39              this.sourceLevelSet = true;
40          }
41      }
42  
43      public String getSourceLevel()
44      {
45          return sourceLevel;
46      }
47            
48  }