KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > annotations > AnnotationsMessages


1 // Copyright 2004, 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.hivemind.annotations;
16
17 import java.lang.reflect.Method JavaDoc;
18 import java.lang.reflect.Modifier JavaDoc;
19
20 import org.apache.hivemind.ClassResolver;
21 import org.apache.hivemind.impl.MessageFormatter;
22 import org.apache.hivemind.service.MethodSignature;
23
24
25 /**
26  * Used to format messages used in errors and log output for classes within the impl package.
27  *
28  * @author Achim Huegen
29  */

30 public class AnnotationsMessages
31 {
32     private static final MessageFormatter _formatter = new MessageFormatter(AnnotationsMessages.class,
33             "AnnotationsStrings");
34
35     static String JavaDoc unableToFindModuleClass(String JavaDoc moduleClassName, ClassResolver resolver)
36     {
37         return _formatter.format("unable-to-find-module-class", resolver, moduleClassName);
38     }
39     
40     public static String JavaDoc moduleClassHasInvalidModifiers(Class JavaDoc moduleClass, int invalidModifiers)
41     {
42         String JavaDoc modifierStr = Modifier.toString(invalidModifiers);
43         return _formatter.format("module-class-has-invalid-modifiers", moduleClass.getName(), modifierStr);
44     }
45     
46     public static String JavaDoc moduleClassIsPackagePrivate(Class JavaDoc moduleClass)
47     {
48         return _formatter.format("module-class-is-package-private", moduleClass.getName());
49     }
50
51     public static String JavaDoc annotatedMethodHasInvalidModifiers(Method JavaDoc method, String JavaDoc methodType, int invalidModifiers)
52     {
53         MethodSignature methodSig = new MethodSignature(method);
54         String JavaDoc modifierStr = Modifier.toString(invalidModifiers);
55         return _formatter.format("annotated-method-has-invalid-modifiers", methodSig.toString(), methodType, modifierStr);
56     }
57
58     public static String JavaDoc annotatedMethodIsProtectedAndNotAccessible(Method JavaDoc method, String JavaDoc methodType)
59     {
60         MethodSignature methodSig = new MethodSignature(method);
61         return _formatter.format("annotated-method-protected-not-accessible", methodSig.toString());
62     }
63
64 }
Popular Tags