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.impl.MessageFormatter; |
21 |
| import org.apache.hivemind.service.ClassFabUtils; |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
| class AnnotationMessages |
29 |
| { |
30 |
| private static final MessageFormatter _formatter = new MessageFormatter( |
31 |
| AnnotationMessages.class); |
32 |
| |
33 |
1
| static String noParametersExpected(Method m)
|
34 |
| { |
35 |
1
| return _formatter.format("no-parameters-expected", m);
|
36 |
| } |
37 |
| |
38 |
1
| static String notAccessor(Method method)
|
39 |
| { |
40 |
1
| return _formatter.format("no-accessor", method);
|
41 |
| } |
42 |
| |
43 |
1
| static String voidAccessor(Method method)
|
44 |
| { |
45 |
1
| return _formatter.format("void-accessor", method);
|
46 |
| } |
47 |
| |
48 |
1
| static String nonVoidMutator(Method method)
|
49 |
| { |
50 |
1
| return _formatter.format("non-void-mutator", method);
|
51 |
| } |
52 |
| |
53 |
1
| static String wrongParameterCount(Method method)
|
54 |
| { |
55 |
1
| return _formatter.format("wrong-parameter-count", method);
|
56 |
| } |
57 |
| |
58 |
2
| static String failureProcessingAnnotation(Annotation annotation, Method method, Throwable cause)
|
59 |
| { |
60 |
2
| return _formatter.format("failure-processing-annotation", annotation, method, cause);
|
61 |
| } |
62 |
| |
63 |
2
| static String failureProcessingClassAnnotation(Annotation annotation, Class clazz,
|
64 |
| Throwable cause) |
65 |
| { |
66 |
2
| return _formatter.format(
|
67 |
| "failure-processing-class-annotation", |
68 |
| annotation, |
69 |
| clazz.getName(), |
70 |
| cause); |
71 |
| } |
72 |
| |
73 |
1
| static String returnStringOnly(Class returnType)
|
74 |
| { |
75 |
1
| return _formatter.format("return-string-only", ClassFabUtils.getJavaClassName(returnType));
|
76 |
| } |
77 |
| |
78 |
6
| static String bindingWrongFormat(String binding)
|
79 |
| { |
80 |
6
| return _formatter.format("binding-wrong-format", binding);
|
81 |
| } |
82 |
| |
83 |
12
| static String methodAnnotation(Annotation annotation, Method method)
|
84 |
| { |
85 |
12
| return _formatter.format("method-annotation", annotation, method);
|
86 |
| } |
87 |
| |
88 |
8
| static String classAnnotation(Annotation annotation, Class clazz)
|
89 |
| { |
90 |
8
| return _formatter.format("class-annotation", annotation, clazz.getName());
|
91 |
| } |
92 |
| |
93 |
| } |