1
2
3
4
5
6
7
8 package org.apache.maven.settings;
9
10
11
12
13
14
15
16
17
18
19 @SuppressWarnings( "all" )
20 public class TrackableBase
21 implements java.io.Serializable, java.lang.Cloneable
22 {
23
24
25
26
27
28
29
30
31
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 }
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 }