KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > annotations > AnnotationMessages


1 // Copyright 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.annotations;
16
17 import java.lang.annotation.Annotation JavaDoc;
18 import java.lang.reflect.Method JavaDoc;
19
20 import org.apache.hivemind.impl.MessageFormatter;
21 import org.apache.hivemind.service.ClassFabUtils;
22
23 /**
24  * @author Howard M. Lewis Ship
25  * @since 4.0
26  */

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