1 | |
package org.apache.maven.tools.plugin.annotations.datamodel; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
import org.apache.maven.plugins.annotations.ResolutionScope; |
23 | |
import org.apache.maven.plugins.annotations.InstanciationStrategy; |
24 | |
import org.apache.maven.plugins.annotations.LifecyclePhase; |
25 | |
import org.apache.maven.plugins.annotations.Mojo; |
26 | |
|
27 | |
import java.lang.annotation.Annotation; |
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | 1 | public class MojoAnnotationContent |
34 | |
extends AnnotatedContent |
35 | |
implements Mojo |
36 | |
{ |
37 | |
private String name; |
38 | |
|
39 | 1 | private LifecyclePhase defaultPhase = LifecyclePhase.NONE; |
40 | |
|
41 | 1 | private ResolutionScope requiresDependencyResolution = ResolutionScope.RUNTIME; |
42 | |
|
43 | 1 | private ResolutionScope requiresDependencyCollection = ResolutionScope.RUNTIME; |
44 | |
|
45 | 1 | private InstanciationStrategy instantiationStrategy = InstanciationStrategy.PER_LOOKUP; |
46 | |
|
47 | 1 | private String executionStrategy = "once-per-session"; |
48 | |
|
49 | 1 | private boolean requiresProject = true; |
50 | |
|
51 | 1 | private boolean requiresReports = false; |
52 | |
|
53 | 1 | private boolean aggregator = false; |
54 | |
|
55 | 1 | private boolean requiresDirectInvocation = false; |
56 | |
|
57 | 1 | private boolean requiresOnline = false; |
58 | |
|
59 | 1 | private boolean inheritByDefault = true; |
60 | |
|
61 | |
private String configurator; |
62 | |
|
63 | 1 | private boolean threadSafe = false; |
64 | |
|
65 | |
public Class<? extends Annotation> annotationType() |
66 | |
{ |
67 | 0 | return null; |
68 | |
} |
69 | |
|
70 | |
public LifecyclePhase defaultPhase() |
71 | |
{ |
72 | 1 | return defaultPhase; |
73 | |
} |
74 | |
|
75 | |
public void defaultPhase( String phase ) |
76 | |
{ |
77 | 1 | this.defaultPhase = LifecyclePhase.valueOf( phase ); |
78 | 1 | } |
79 | |
|
80 | |
public ResolutionScope requiresDependencyResolution() |
81 | |
{ |
82 | 0 | return requiresDependencyResolution; |
83 | |
} |
84 | |
|
85 | |
public void requiresDependencyResolution( String requiresDependencyResolution ) |
86 | |
{ |
87 | 0 | this.requiresDependencyResolution = ResolutionScope.valueOf( requiresDependencyResolution ); |
88 | 0 | } |
89 | |
|
90 | |
public ResolutionScope requiresDependencyCollection() |
91 | |
{ |
92 | 0 | return requiresDependencyCollection; |
93 | |
} |
94 | |
|
95 | |
public void requiresDependencyCollection( String requiresDependencyCollection ) |
96 | |
{ |
97 | 0 | this.requiresDependencyCollection = ResolutionScope.valueOf( requiresDependencyCollection ); |
98 | 0 | } |
99 | |
|
100 | |
public InstanciationStrategy instantiationStrategy() |
101 | |
{ |
102 | 0 | return instantiationStrategy; |
103 | |
} |
104 | |
|
105 | |
public void instantiationStrategy( String instantiationStrategy ) |
106 | |
{ |
107 | 0 | this.instantiationStrategy = InstanciationStrategy.valueOf( instantiationStrategy ); |
108 | 0 | } |
109 | |
|
110 | |
public String executionStrategy() |
111 | |
{ |
112 | 0 | return executionStrategy; |
113 | |
} |
114 | |
|
115 | |
public void executionStrategy( String executionStrategy ) |
116 | |
{ |
117 | 0 | this.executionStrategy = executionStrategy; |
118 | 0 | } |
119 | |
|
120 | |
public boolean requiresProject() |
121 | |
{ |
122 | 0 | return requiresProject; |
123 | |
} |
124 | |
|
125 | |
public void requiresProject( boolean requiresProject ) |
126 | |
{ |
127 | 0 | this.requiresProject = requiresProject; |
128 | 0 | } |
129 | |
|
130 | |
public boolean requiresReports() |
131 | |
{ |
132 | 0 | return requiresReports; |
133 | |
} |
134 | |
|
135 | |
public void requiresReports( boolean requiresReports ) |
136 | |
{ |
137 | 0 | this.requiresReports = requiresReports; |
138 | 0 | } |
139 | |
|
140 | |
public boolean aggregator() |
141 | |
{ |
142 | 1 | return aggregator; |
143 | |
} |
144 | |
|
145 | |
public void aggregator( boolean aggregator ) |
146 | |
{ |
147 | 0 | this.aggregator = aggregator; |
148 | 0 | } |
149 | |
|
150 | |
public boolean requiresDirectInvocation() |
151 | |
{ |
152 | 0 | return requiresDirectInvocation; |
153 | |
} |
154 | |
|
155 | |
public void requiresDirectInvocation( boolean requiresDirectInvocation ) |
156 | |
{ |
157 | 0 | this.requiresDirectInvocation = requiresDirectInvocation; |
158 | 0 | } |
159 | |
|
160 | |
public boolean requiresOnline() |
161 | |
{ |
162 | 0 | return requiresOnline; |
163 | |
} |
164 | |
|
165 | |
public void requiresOnline( boolean requiresOnline ) |
166 | |
{ |
167 | 0 | this.requiresOnline = requiresOnline; |
168 | 0 | } |
169 | |
|
170 | |
public boolean inheritByDefault() |
171 | |
{ |
172 | 0 | return inheritByDefault; |
173 | |
} |
174 | |
|
175 | |
public void inheritByDefault( boolean inheritByDefault ) |
176 | |
{ |
177 | 0 | this.inheritByDefault = inheritByDefault; |
178 | 0 | } |
179 | |
|
180 | |
public String configurator() |
181 | |
{ |
182 | 0 | return configurator; |
183 | |
} |
184 | |
|
185 | |
public void configurator( String configurator ) |
186 | |
{ |
187 | 0 | this.configurator = configurator; |
188 | 0 | } |
189 | |
|
190 | |
public boolean threadSafe() |
191 | |
{ |
192 | 1 | return threadSafe; |
193 | |
} |
194 | |
|
195 | |
public void threadSafe( boolean threadSafe ) |
196 | |
{ |
197 | 1 | this.threadSafe = threadSafe; |
198 | 1 | } |
199 | |
|
200 | |
public String name() |
201 | |
{ |
202 | 1 | return this.name; |
203 | |
} |
204 | |
|
205 | |
public void name( String name ) |
206 | |
{ |
207 | 1 | this.name = name; |
208 | 1 | } |
209 | |
|
210 | |
@Override |
211 | |
public String toString() |
212 | |
{ |
213 | 2 | final StringBuilder sb = new StringBuilder(); |
214 | 2 | sb.append( "MojoAnnotationContent" ); |
215 | 2 | sb.append( "{name='" ).append( name ).append( '\'' ); |
216 | 2 | sb.append( ", defaultPhase=" ).append( defaultPhase ); |
217 | 2 | sb.append( ", requiresDependencyResolution='" ).append( requiresDependencyResolution ).append( '\'' ); |
218 | 2 | sb.append( ", requiresDependencyCollection='" ).append( requiresDependencyCollection ).append( '\'' ); |
219 | 2 | sb.append( ", instantiationStrategy='" ).append( instantiationStrategy ).append( '\'' ); |
220 | 2 | sb.append( ", executionStrategy='" ).append( executionStrategy ).append( '\'' ); |
221 | 2 | sb.append( ", requiresProject=" ).append( requiresProject ); |
222 | 2 | sb.append( ", requiresReports=" ).append( requiresReports ); |
223 | 2 | sb.append( ", aggregator=" ).append( aggregator ); |
224 | 2 | sb.append( ", requiresDirectInvocation=" ).append( requiresDirectInvocation ); |
225 | 2 | sb.append( ", requiresOnline=" ).append( requiresOnline ); |
226 | 2 | sb.append( ", inheritByDefault=" ).append( inheritByDefault ); |
227 | 2 | sb.append( ", configurator='" ).append( configurator ).append( '\'' ); |
228 | 2 | sb.append( ", threadSafe=" ).append( threadSafe ); |
229 | 2 | sb.append( '}' ); |
230 | 2 | return sb.toString(); |
231 | |
} |
232 | |
} |