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.Component; |
23 | |
|
24 | |
import java.lang.annotation.Annotation; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
public class ComponentAnnotationContent |
31 | |
extends AnnotatedField |
32 | |
implements Component |
33 | |
{ |
34 | |
private String roleClassName; |
35 | |
|
36 | |
private String hint; |
37 | |
|
38 | |
public ComponentAnnotationContent( String fieldName ) |
39 | |
{ |
40 | 2 | super( fieldName ); |
41 | 2 | } |
42 | |
|
43 | |
public ComponentAnnotationContent( String fieldName, String role, String hint ) |
44 | |
{ |
45 | 0 | this( fieldName ); |
46 | 0 | this.roleClassName = role; |
47 | 0 | this.hint = hint; |
48 | 0 | } |
49 | |
|
50 | |
public Class<?> role() |
51 | |
{ |
52 | |
|
53 | 0 | return null; |
54 | |
} |
55 | |
|
56 | |
public void setRoleClassName( String roleClassName ) |
57 | |
{ |
58 | 2 | this.roleClassName = roleClassName; |
59 | 2 | } |
60 | |
|
61 | |
public String getRoleClassName() |
62 | |
{ |
63 | 2 | return roleClassName; |
64 | |
} |
65 | |
|
66 | |
public String hint() |
67 | |
{ |
68 | 0 | return hint == null ? "" : hint; |
69 | |
} |
70 | |
|
71 | |
public void hint( String hint ) |
72 | |
{ |
73 | 1 | this.hint = hint; |
74 | 1 | } |
75 | |
|
76 | |
public Class<? extends Annotation> annotationType() |
77 | |
{ |
78 | 0 | return null; |
79 | |
} |
80 | |
|
81 | |
@Override |
82 | |
public String toString() |
83 | |
{ |
84 | 4 | final StringBuilder sb = new StringBuilder(); |
85 | 4 | sb.append( super.toString() ); |
86 | 4 | sb.append( "ComponentAnnotationContent" ); |
87 | 4 | sb.append( "{role='" ).append( roleClassName ).append( '\'' ); |
88 | 4 | sb.append( ", hint='" ).append( hint ).append( '\'' ); |
89 | 4 | sb.append( '}' ); |
90 | 4 | return sb.toString(); |
91 | |
} |
92 | |
} |