Here you can find the source of getResourceString(ResourceBundle rb, String key, Object param1)
Parameter | Description |
---|---|
rb | resource bundle |
key | key of string in properties file |
param1 | first parameter |
public static String getResourceString(ResourceBundle rb, String key, Object param1)
//package com.java2s; /*/*from www . j ava 2s. c o m*/ * Created 13.01.2005 at 12:57:31 * ==================================================================== * * Copyright 2004-2005 Ignat Aleksandrov, Kamil Shamgunov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.text.MessageFormat; import java.util.ResourceBundle; public class Main { /** * Get formatted string from resource bundle * * @param rb resource bundle * @param key key of string in properties file * @param param1 first parameter * @return formatted string */ public static String getResourceString(ResourceBundle rb, String key, Object param1) { String raw = rb.getString(key); Object params[] = new Object[1]; params[0] = param1; String formatted = MessageFormat.format(raw, params); return formatted; } }