1 | |
package org.apache.maven.tools.plugin.annotations.scanner; |
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.artifact.Artifact; |
23 | |
import org.apache.maven.tools.plugin.annotations.datamodel.ComponentAnnotationContent; |
24 | |
import org.apache.maven.tools.plugin.annotations.datamodel.ExecuteAnnotationContent; |
25 | |
import org.apache.maven.tools.plugin.annotations.datamodel.MojoAnnotationContent; |
26 | |
import org.apache.maven.tools.plugin.annotations.datamodel.ParameterAnnotationContent; |
27 | |
|
28 | |
import java.util.HashMap; |
29 | |
import java.util.Map; |
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
public class MojoAnnotatedClass |
36 | |
{ |
37 | |
private String className; |
38 | |
|
39 | |
private String parentClassName; |
40 | |
|
41 | |
private MojoAnnotationContent mojo; |
42 | |
|
43 | |
private ExecuteAnnotationContent execute; |
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
private Map<String, ParameterAnnotationContent> parameters; |
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
private Map<String, ComponentAnnotationContent> components; |
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
private Artifact artifact; |
59 | |
|
60 | |
public MojoAnnotatedClass() |
61 | 2 | { |
62 | |
|
63 | 2 | } |
64 | |
|
65 | |
public String getClassName() |
66 | |
{ |
67 | 6 | return className; |
68 | |
} |
69 | |
|
70 | |
public MojoAnnotatedClass setClassName( String className ) |
71 | |
{ |
72 | 2 | this.className = className; |
73 | 2 | return this; |
74 | |
} |
75 | |
|
76 | |
public MojoAnnotationContent getMojo() |
77 | |
{ |
78 | 2 | return mojo; |
79 | |
} |
80 | |
|
81 | |
public MojoAnnotatedClass setMojo( MojoAnnotationContent mojo ) |
82 | |
{ |
83 | 2 | this.mojo = mojo; |
84 | 2 | return this; |
85 | |
} |
86 | |
|
87 | |
public ExecuteAnnotationContent getExecute() |
88 | |
{ |
89 | 2 | return execute; |
90 | |
} |
91 | |
|
92 | |
public MojoAnnotatedClass setExecute( ExecuteAnnotationContent execute ) |
93 | |
{ |
94 | 2 | this.execute = execute; |
95 | 2 | return this; |
96 | |
} |
97 | |
|
98 | |
public Map<String, ParameterAnnotationContent> getParameters() |
99 | |
{ |
100 | 6 | if ( this.parameters == null ) |
101 | |
{ |
102 | 2 | this.parameters = new HashMap<String, ParameterAnnotationContent>(); |
103 | |
} |
104 | 6 | return parameters; |
105 | |
} |
106 | |
|
107 | |
public MojoAnnotatedClass setParameters( Map<String, ParameterAnnotationContent> parameters ) |
108 | |
{ |
109 | 0 | this.parameters = parameters; |
110 | 0 | return this; |
111 | |
} |
112 | |
|
113 | |
public Map<String, ComponentAnnotationContent> getComponents() |
114 | |
{ |
115 | 6 | if ( this.components == null ) |
116 | |
{ |
117 | 2 | this.components = new HashMap<String, ComponentAnnotationContent>(); |
118 | |
} |
119 | 6 | return components; |
120 | |
} |
121 | |
|
122 | |
public MojoAnnotatedClass setComponents( Map<String, ComponentAnnotationContent> components ) |
123 | |
{ |
124 | 0 | this.components = components; |
125 | 0 | return this; |
126 | |
} |
127 | |
|
128 | |
public String getParentClassName() |
129 | |
{ |
130 | 2 | return parentClassName; |
131 | |
} |
132 | |
|
133 | |
public MojoAnnotatedClass setParentClassName( String parentClassName ) |
134 | |
{ |
135 | 2 | this.parentClassName = parentClassName; |
136 | 2 | return this; |
137 | |
} |
138 | |
|
139 | |
public Artifact getArtifact() |
140 | |
{ |
141 | 0 | return artifact; |
142 | |
} |
143 | |
|
144 | |
public void setArtifact( Artifact artifact ) |
145 | |
{ |
146 | 2 | this.artifact = artifact; |
147 | 2 | } |
148 | |
|
149 | |
@Override |
150 | |
public String toString() |
151 | |
{ |
152 | 4 | final StringBuilder sb = new StringBuilder(); |
153 | 4 | sb.append( "MojoAnnotatedClass" ); |
154 | 4 | sb.append( "{className='" ).append( className ).append( '\'' ); |
155 | 4 | sb.append( ", parentClassName='" ).append( parentClassName ).append( '\'' ); |
156 | 4 | sb.append( ", mojo=" ).append( mojo ); |
157 | 4 | sb.append( ", execute=" ).append( execute ); |
158 | 4 | sb.append( ", parameters=" ).append( parameters ); |
159 | 4 | sb.append( ", components=" ).append( components ); |
160 | 4 | sb.append( '}' ); |
161 | 4 | return sb.toString(); |
162 | |
} |
163 | |
} |