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.stockquote;
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 {@link MessageFactory} in core.
19: */
20: public class LocaleMessage extends MessageFactory {
21: /**
22: * Note that the messages for this example are not in mule's standard
23: * META-INF/services/org/mule/i18n folder but in a different resource bundle.
24: */
25: private static final String BUNDLE_PATH = "messages.stockquote-example-messages";
26:
27: public static String getStockQuoteMessage(String symbol,
28: String name, String date, String last, String change,
29: String open, String high, String low, String volume,
30: String previousClose) {
31: String[] params = { symbol, name, date, last, change, open,
32: high, low, volume, previousClose };
33: return getString(BUNDLE_PATH, 1, params);
34: }
35: }
|