Java Resource Message getMessage(String key)

Here you can find the source of getMessage(String key)

Description

get Message

License

Apache License

Declaration

public static String getMessage(String key) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.MessageFormat;
import java.util.ResourceBundle;

public class Main {
    private static final ResourceBundle resource = ResourceBundle.getBundle("errorCode");

    public static String getMessage(String key) {
        return resource.getString(key);
    }//from  w w w.  j a  v  a 2  s  .  c  o m

    public static String getMessage(String key, Object... arguments) {
        return MessageFormat.format(resource.getString(key), arguments);
    }
}

Related

  1. getMessage(ResourceBundle messages, String messageKey)
  2. getMessage(ResourceBundle messages, String msgKey, Object[] arguments)
  3. getMessage(String bundleName, Locale locale, String key, String defaultMsg)
  4. getMessage(String key)
  5. getMessage(String key)
  6. getMessage(String key, Object... contents)
  7. getMessage(String key, Object... values)
  8. getMessage(String key, String... fill)
  9. getMessage(String messageKey)