Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Profile |
|
| 1.0;1 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.model; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * Modifications to the build process which is activated based on | |
15 | * environmental | |
16 | * parameters or command line arguments. | |
17 | * | |
18 | * @version $Revision$ $Date$ | |
19 | */ | |
20 | 0 | public class Profile extends ModelBase |
21 | implements java.io.Serializable | |
22 | { | |
23 | ||
24 | ||
25 | //--------------------------/ | |
26 | //- Class/Member Variables -/ | |
27 | //--------------------------/ | |
28 | ||
29 | /** | |
30 | * The identifier of this build profile. This used both for | |
31 | * command line | |
32 | * activation, and identifies identical profiles to | |
33 | * merge with during inheritance. | |
34 | * | |
35 | */ | |
36 | private String id; | |
37 | ||
38 | /** | |
39 | * The conditional logic which will automatically trigger the | |
40 | * inclusion of this | |
41 | * profile. | |
42 | */ | |
43 | private Activation activation; | |
44 | ||
45 | /** | |
46 | * Information required to build the project. | |
47 | */ | |
48 | private BuildBase build; | |
49 | ||
50 | ||
51 | //-----------/ | |
52 | //- Methods -/ | |
53 | //-----------/ | |
54 | ||
55 | /** | |
56 | * Get the conditional logic which will automatically trigger | |
57 | * the inclusion of this | |
58 | * profile. | |
59 | * | |
60 | * @return Activation | |
61 | */ | |
62 | public Activation getActivation() | |
63 | { | |
64 | 0 | return this.activation; |
65 | } //-- Activation getActivation() | |
66 | ||
67 | /** | |
68 | * Get information required to build the project. | |
69 | * | |
70 | * @return BuildBase | |
71 | */ | |
72 | public BuildBase getBuild() | |
73 | { | |
74 | 0 | return this.build; |
75 | } //-- BuildBase getBuild() | |
76 | ||
77 | /** | |
78 | * Get the identifier of this build profile. This used both for | |
79 | * command line | |
80 | * activation, and identifies identical profiles to | |
81 | * merge with during inheritance. | |
82 | * | |
83 | * | |
84 | * @return String | |
85 | */ | |
86 | public String getId() | |
87 | { | |
88 | 0 | return this.id; |
89 | } //-- String getId() | |
90 | ||
91 | /** | |
92 | * Set the conditional logic which will automatically trigger | |
93 | * the inclusion of this | |
94 | * profile. | |
95 | * | |
96 | * @param activation | |
97 | */ | |
98 | public void setActivation( Activation activation ) | |
99 | { | |
100 | 0 | this.activation = activation; |
101 | 0 | } //-- void setActivation( Activation ) |
102 | ||
103 | /** | |
104 | * Set information required to build the project. | |
105 | * | |
106 | * @param build | |
107 | */ | |
108 | public void setBuild( BuildBase build ) | |
109 | { | |
110 | 0 | this.build = build; |
111 | 0 | } //-- void setBuild( BuildBase ) |
112 | ||
113 | /** | |
114 | * Set the identifier of this build profile. This used both for | |
115 | * command line | |
116 | * activation, and identifies identical profiles to | |
117 | * merge with during inheritance. | |
118 | * | |
119 | * | |
120 | * @param id | |
121 | */ | |
122 | public void setId( String id ) | |
123 | { | |
124 | 0 | this.id = id; |
125 | 0 | } //-- void setId( String ) |
126 | ||
127 | ||
128 | ||
129 | // We don't want this to be parseable...it's sort of 'hidden' | |
130 | // default source for this profile is in the pom itself. | |
131 | 0 | private String source = "pom"; |
132 | ||
133 | public void setSource( String source ) | |
134 | { | |
135 | 0 | this.source = source; |
136 | 0 | } |
137 | ||
138 | public String getSource() | |
139 | { | |
140 | 0 | return source; |
141 | } | |
142 | ||
143 | /** | |
144 | * @see java.lang.Object#toString() | |
145 | */ | |
146 | public String toString() | |
147 | { | |
148 | 0 | return "Profile {id: " + getId() + ", source: " + getSource() + "}"; |
149 | } | |
150 | ||
151 | ||
152 | 0 | private String modelEncoding = "UTF-8"; |
153 | ||
154 | /** | |
155 | * Set an encoding used for reading/writing the model. | |
156 | * | |
157 | * @param modelEncoding the encoding used when reading/writing the model. | |
158 | */ | |
159 | public void setModelEncoding( String modelEncoding ) | |
160 | { | |
161 | 0 | this.modelEncoding = modelEncoding; |
162 | 0 | } |
163 | ||
164 | /** | |
165 | * @return the current encoding used when reading/writing this model. | |
166 | */ | |
167 | public String getModelEncoding() | |
168 | { | |
169 | 0 | return modelEncoding; |
170 | } | |
171 | } |