1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
package org.apache.tapestry.annotations; |
16 |
|
|
17 |
|
import java.lang.annotation.Annotation; |
18 |
|
import java.lang.reflect.Method; |
19 |
|
|
20 |
|
import org.apache.hivemind.Location; |
21 |
|
import org.apache.hivemind.impl.MessageFormatter; |
22 |
|
import org.apache.hivemind.service.ClassFabUtils; |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
final class AnnotationMessages |
30 |
|
{ |
31 |
1 |
private static final MessageFormatter _formatter = new MessageFormatter( |
32 |
|
AnnotationMessages.class); |
33 |
|
|
34 |
|
|
35 |
0 |
private AnnotationMessages() { } |
36 |
|
|
37 |
|
static String noParametersExpected(Method m) |
38 |
|
{ |
39 |
1 |
return _formatter.format("no-parameters-expected", m); |
40 |
|
} |
41 |
|
|
42 |
|
static String notAccessor(Method method) |
43 |
|
{ |
44 |
1 |
return _formatter.format("no-accessor", method); |
45 |
|
} |
46 |
|
|
47 |
|
static String voidAccessor(Method method) |
48 |
|
{ |
49 |
1 |
return _formatter.format("void-accessor", method); |
50 |
|
} |
51 |
|
|
52 |
|
static String nonVoidMutator(Method method) |
53 |
|
{ |
54 |
1 |
return _formatter.format("non-void-mutator", method); |
55 |
|
} |
56 |
|
|
57 |
|
static String wrongParameterCount(Method method) |
58 |
|
{ |
59 |
1 |
return _formatter.format("wrong-parameter-count", method); |
60 |
|
} |
61 |
|
|
62 |
|
static String failureProcessingAnnotation(Annotation annotation, Method method, Throwable cause) |
63 |
|
{ |
64 |
2 |
return _formatter.format("failure-processing-annotation", annotation, method, cause); |
65 |
|
} |
66 |
|
|
67 |
|
static String failureProcessingClassAnnotation(Annotation annotation, Class clazz, |
68 |
|
Throwable cause) |
69 |
|
{ |
70 |
2 |
return _formatter.format( |
71 |
|
"failure-processing-class-annotation", |
72 |
|
annotation, |
73 |
|
clazz.getName(), |
74 |
|
cause); |
75 |
|
} |
76 |
|
|
77 |
|
static String returnStringOnly(Class returnType) |
78 |
|
{ |
79 |
1 |
return _formatter.format("return-string-only", ClassFabUtils.getJavaClassName(returnType)); |
80 |
|
} |
81 |
|
|
82 |
|
static String bindingWrongFormat(String binding) |
83 |
|
{ |
84 |
6 |
return _formatter.format("binding-wrong-format", binding); |
85 |
|
} |
86 |
|
|
87 |
|
static String methodAnnotation(Annotation annotation, Method method) |
88 |
|
{ |
89 |
14 |
return _formatter.format("method-annotation", annotation, method); |
90 |
|
} |
91 |
|
|
92 |
|
static String classAnnotation(Annotation annotation, Class clazz) |
93 |
|
{ |
94 |
8 |
return _formatter.format("class-annotation", annotation, clazz.getName()); |
95 |
|
} |
96 |
|
|
97 |
|
static String missingEqualsInMeta(String value) |
98 |
|
{ |
99 |
1 |
return _formatter.format("missing-equals-in-meta", value); |
100 |
|
} |
101 |
|
|
102 |
|
static String failureEnhancingMethod(Method method, Exception cause) |
103 |
|
{ |
104 |
4 |
return _formatter.format("failure-enhancing-method", method, cause); |
105 |
|
} |
106 |
|
|
107 |
|
static String targetsNotFound(Method method) |
108 |
|
{ |
109 |
1 |
return _formatter.format("no-targets-found", method); |
110 |
|
} |
111 |
|
|
112 |
|
static String invalidAnnotationInClass(Class annotation, Class clazz) |
113 |
|
{ |
114 |
2 |
return _formatter.format("invalid-annotation-in-class", annotation.getName(), clazz.getName()); |
115 |
|
} |
116 |
|
|
117 |
|
static String unableToCopy(String id) |
118 |
|
{ |
119 |
1 |
return _formatter.format("unable-to-copy", id); |
120 |
|
} |
121 |
|
|
122 |
|
static String bothTypeAndCopyOf(String id) |
123 |
|
{ |
124 |
1 |
return _formatter.format("both-type-and-copy-of", id); |
125 |
|
} |
126 |
|
|
127 |
|
static String unknownAsset(String name, Location l) |
128 |
|
{ |
129 |
1 |
return _formatter.format("missing-asset-property", name, l); |
130 |
|
} |
131 |
|
} |