View Javadoc
1   /*
2    Licensed to the Apache Software Foundation (ASF) under one
3    or more contributor license agreements.  See the NOTICE file
4    distributed with this work for additional information
5    regarding copyright ownership.  The ASF licenses this file
6    to you under the Apache License, Version 2.0 (the
7    "License"); you may not use this file except in compliance
8    with the License.  You may obtain a copy of the License at
9    
10       http://www.apache.org/licenses/LICENSE-2.0
11   
12   Unless required by applicable law or agreed to in writing,
13   software distributed under the License is distributed on an
14   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   KIND, either express or implied.  See the License for the
16   specific language governing permissions and limitations
17   under the License.
18   =================== DO NOT EDIT THIS FILE ====================
19   Generated by Modello 2.4.0,
20   any modifications will be overwritten.
21   ==============================================================
22   */
23  
24  package org.apache.maven.settings;
25  
26  /**
27   * 
28   *         common base class that contains code to track the source
29   * for
30   *         this instance (USER|GLOBAL)
31   *       .
32   * 
33   * @version $Revision$ $Date$
34   */
35  @SuppressWarnings( "all" )
36  public class TrackableBase
37      implements java.io.Serializable, java.lang.Cloneable
38  {
39  
40        //-----------/
41       //- Methods -/
42      //-----------/
43  
44      /**
45       * Method clone.
46       * 
47       * @return TrackableBase
48       */
49      public TrackableBase clone()
50      {
51          try
52          {
53              TrackableBase copy = (TrackableBase) super.clone();
54  
55              return copy;
56          }
57          catch ( java.lang.Exception ex )
58          {
59              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
60                  + " does not support clone()" ).initCause( ex );
61          }
62      } //-- TrackableBase clone()
63  
64      
65              
66      public static final String USER_LEVEL = "user-level";
67      public static final String GLOBAL_LEVEL = "global-level";
68  
69      private String sourceLevel = USER_LEVEL;
70      private boolean sourceLevelSet = false;
71  
72      public void setSourceLevel( String sourceLevel )
73      {
74          if ( sourceLevelSet )
75          {
76              throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
77          }
78          else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
79          {
80              throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
81          }
82          else
83          {
84              this.sourceLevel = sourceLevel;
85              this.sourceLevelSet = true;
86          }
87      }
88  
89      public String getSourceLevel()
90      {
91          return sourceLevel;
92      }
93              
94            
95  }