View Javadoc

1   /*
2    * $Id: AnnotationsMessages.java 20321 2010-11-24 15:21:24Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  package org.mule.config.i18n;
11  
12  import org.mule.util.StringUtils;
13  
14  import java.lang.annotation.Annotation;
15  import java.lang.reflect.Method;
16  
17  /**
18   * Internationalized messages specific to the annotations module
19   */
20  public class AnnotationsMessages extends MessageFactory
21  {
22      private static final String BUNDLE_PATH = getBundlePath("annotations");
23  
24      private static final AnnotationsMessages factory = new AnnotationsMessages();
25  
26      public static Message serviceDoesNotHaveAnnotation(Class serviceClass, String annotationName)
27      {
28          return factory.createMessage(BUNDLE_PATH, 1, serviceClass.getName(), annotationName);
29      }
30  
31      public static Message serviceHasNoEntrypoint(Class serviceClass)
32      {
33          return factory.createMessage(BUNDLE_PATH, 2, serviceClass.getName());
34      }
35  
36      public static Message noParserFoundForAnnotation(Annotation annotation)
37      {
38          return factory.createMessage(BUNDLE_PATH, 3, annotation);
39      }
40  
41      public static Message noPropertyConverterForType(Class type)
42      {
43          return factory.createMessage(BUNDLE_PATH, 4, type);
44      }
45  
46      public static Message failedToInvokeReplyMethod(String method)
47      {
48          return factory.createMessage(BUNDLE_PATH, 5, method);
49      }
50  
51      public static Message transformerMethodNotValid(Method method)
52      {
53          return factory.createMessage(BUNDLE_PATH, 6, method);
54      }
55  
56      public static Message lookupNotFoundInRegistry(Class type, String name, Class object)
57      {
58          return factory.createMessage(BUNDLE_PATH, 7, type, (StringUtils.isBlank(name) ? "[no name]" : name), object);
59      }
60  
61      public static Message lookupFailedSeePreviousException(Object object)
62      {
63          return factory.createMessage(BUNDLE_PATH, 8, object);
64      }
65  }
66