Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Execution |
|
| 1.625;1.625 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.plugin.lifecycle; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * A set of goals to execute. | |
15 | * | |
16 | * @version $Revision$ $Date$ | |
17 | */ | |
18 | 0 | public class Execution implements java.io.Serializable { |
19 | ||
20 | ||
21 | //--------------------------/ | |
22 | //- Class/Member Variables -/ | |
23 | //--------------------------/ | |
24 | ||
25 | /** | |
26 | * Configuration to pass to the goals. | |
27 | */ | |
28 | private Object configuration; | |
29 | ||
30 | /** | |
31 | * Field goals. | |
32 | */ | |
33 | private java.util.List goals; | |
34 | ||
35 | ||
36 | //-----------/ | |
37 | //- Methods -/ | |
38 | //-----------/ | |
39 | ||
40 | /** | |
41 | * Method addGoal. | |
42 | * | |
43 | * @param string | |
44 | */ | |
45 | public void addGoal( String string ) | |
46 | { | |
47 | 0 | if ( !(string instanceof String) ) |
48 | { | |
49 | 0 | throw new ClassCastException( "Execution.addGoals(string) parameter must be instanceof " + String.class.getName() ); |
50 | } | |
51 | 0 | getGoals().add( string ); |
52 | 0 | } //-- void addGoal( String ) |
53 | ||
54 | /** | |
55 | * Get configuration to pass to the goals. | |
56 | * | |
57 | * @return Object | |
58 | */ | |
59 | public Object getConfiguration() | |
60 | { | |
61 | 0 | return this.configuration; |
62 | } //-- Object getConfiguration() | |
63 | ||
64 | /** | |
65 | * Method getGoals. | |
66 | * | |
67 | * @return java.util.List | |
68 | */ | |
69 | public java.util.List getGoals() | |
70 | { | |
71 | 0 | if ( this.goals == null ) |
72 | { | |
73 | 0 | this.goals = new java.util.ArrayList(); |
74 | } | |
75 | ||
76 | 0 | return this.goals; |
77 | } //-- java.util.List getGoals() | |
78 | ||
79 | /** | |
80 | * Method removeGoal. | |
81 | * | |
82 | * @param string | |
83 | */ | |
84 | public void removeGoal( String string ) | |
85 | { | |
86 | 0 | if ( !(string instanceof String) ) |
87 | { | |
88 | 0 | throw new ClassCastException( "Execution.removeGoals(string) parameter must be instanceof " + String.class.getName() ); |
89 | } | |
90 | 0 | getGoals().remove( string ); |
91 | 0 | } //-- void removeGoal( String ) |
92 | ||
93 | /** | |
94 | * Set configuration to pass to the goals. | |
95 | * | |
96 | * @param configuration | |
97 | */ | |
98 | public void setConfiguration( Object configuration ) | |
99 | { | |
100 | 0 | this.configuration = configuration; |
101 | 0 | } //-- void setConfiguration( Object ) |
102 | ||
103 | /** | |
104 | * Set the goals to execute. | |
105 | * | |
106 | * @param goals | |
107 | */ | |
108 | public void setGoals( java.util.List goals ) | |
109 | { | |
110 | 0 | this.goals = goals; |
111 | 0 | } //-- void setGoals( java.util.List ) |
112 | ||
113 | ||
114 | 0 | private String modelEncoding = "UTF-8"; |
115 | ||
116 | /** | |
117 | * Set an encoding used for reading/writing the model. | |
118 | * | |
119 | * @param modelEncoding the encoding used when reading/writing the model. | |
120 | */ | |
121 | public void setModelEncoding( String modelEncoding ) | |
122 | { | |
123 | 0 | this.modelEncoding = modelEncoding; |
124 | 0 | } |
125 | ||
126 | /** | |
127 | * @return the current encoding used when reading/writing this model. | |
128 | */ | |
129 | public String getModelEncoding() | |
130 | { | |
131 | 0 | return modelEncoding; |
132 | } | |
133 | } |