View Javadoc

1   /*
2    * $Id: LocaleMessage.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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.samples.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      /**
23       * Note that the messages for this example are not in mule's standard
24       * META-INF/services/org/mule/i18n folder but in a different resource bundle.
25       */
26      private static final String BUNDLE_PATH = "messages.stockquote-example-messages";
27  
28      public static String getStockQuoteMessage(String symbol, String name, String date, String last, 
29          String change, String open, String high, String low, String volume, String previousClose)
30      {
31          String[] params = { symbol, name, date, last, change, open, high,
32              low, volume, previousClose };
33          return getString(BUNDLE_PATH, 1, params);
34      }
35  }