1 /*
2 * $Id: LocaleMessage.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
11 package org.mule.example.hello;
12
13 import org.mule.config.i18n.MessageFactory;
14
15 /**
16 * <code>LocaleMessage</code> is a convenience interface for retrieving
17 * internationalised strings from resource bundles. The actual work is done by
18 * the MessageFactory in core.
19 */
20 public class LocaleMessage extends MessageFactory
21 {
22 private static final LocaleMessage factory = new LocaleMessage();
23
24 private static final String BUNDLE_PATH = "messages.hello-example-messages";
25
26 public static String getGreetingPart2()
27 {
28 return factory.getString(BUNDLE_PATH, 1);
29 }
30
31 public static String getGreetingPart1()
32 {
33 return factory.getString(BUNDLE_PATH, 2);
34 }
35
36 public static String getPrompt()
37 {
38 return factory.getString(BUNDLE_PATH, 3);
39 }
40
41 public static String getInvalidUserNameError()
42 {
43 return factory.getString(BUNDLE_PATH, 4);
44 }
45 }