1
2
3
4
5 package org.apache.maven.settings;
6
7
8
9
10
11 import java.util.Date;
12
13
14
15
16
17
18
19
20
21
22 public class TrackableBase implements java.io.Serializable {
23
24
25
26 public static final String USER_LEVEL = "user-level";
27 public static final String GLOBAL_LEVEL = "global-level";
28
29 private String sourceLevel = USER_LEVEL;
30 private boolean sourceLevelSet = false;
31
32 public void setSourceLevel( String sourceLevel )
33 {
34 if ( sourceLevelSet )
35 {
36 throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
37 }
38 else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
39 {
40 throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
41 }
42 else
43 {
44 this.sourceLevel = sourceLevel;
45 this.sourceLevelSet = true;
46 }
47 }
48
49 public String getSourceLevel()
50 {
51 return sourceLevel;
52 }
53
54
55 private String modelEncoding = "UTF-8";
56
57
58
59
60
61
62 public void setModelEncoding( String modelEncoding )
63 {
64 this.modelEncoding = modelEncoding;
65 }
66
67
68
69
70 public String getModelEncoding()
71 {
72 return modelEncoding;
73 }
74 }