1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
package org.apache.maven.plugin.registry; |
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | 0 | 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 | 0 | private String sourceLevel = USER_LEVEL; |
24 | 0 | private boolean sourceLevelSet = false; |
25 | |
|
26 | |
public void setSourceLevel( String sourceLevel ) |
27 | |
{ |
28 | 0 | if ( sourceLevelSet ) |
29 | |
{ |
30 | 0 | throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel ); |
31 | |
} |
32 | 0 | else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) ) |
33 | |
{ |
34 | 0 | throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" ); |
35 | |
} |
36 | |
else |
37 | |
{ |
38 | 0 | this.sourceLevel = sourceLevel; |
39 | 0 | this.sourceLevelSet = true; |
40 | |
} |
41 | 0 | } |
42 | |
|
43 | |
public String getSourceLevel() |
44 | |
{ |
45 | 0 | return sourceLevel; |
46 | |
} |
47 | |
|
48 | |
} |