1
2
3
4
5
6
7
8 package org.apache.maven.plugin.registry;
9
10
11
12
13
14
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 }