01: /*
02: * $Id: LocaleMessage.java 10789 2008-02-12 20:04:43Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
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: private static final String BUNDLE_PATH = "messages.hello-example-messages";
22:
23: public static String getGreetingPart2() {
24: return getString(BUNDLE_PATH, 1);
25: }
26:
27: public static String getGreetingPart1() {
28: return getString(BUNDLE_PATH, 2);
29: }
30:
31: public static String getPrompt() {
32: return getString(BUNDLE_PATH, 3);
33: }
34:
35: public static String getInvalidUserNameError() {
36: return getString(BUNDLE_PATH, 4);
37: }
38: }
|