48 lines
1.0 KiB
Plaintext
Executable File
48 lines
1.0 KiB
Plaintext
Executable File
/**
|
|
*
|
|
*/
|
|
package com.fp.frontend.utility;
|
|
|
|
import java.text.MessageFormat;
|
|
import java.util.MissingResourceException;
|
|
import java.util.ResourceBundle;
|
|
|
|
/**
|
|
* @author amerchan
|
|
*
|
|
*/
|
|
public class MsgGeneral {
|
|
private static final String BUNDLE_NAME = "general_es";
|
|
|
|
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
|
|
|
|
private MsgGeneral() {
|
|
}
|
|
|
|
public static String getProperty(String key) {
|
|
try {
|
|
return RESOURCE_BUNDLE.getString(key);
|
|
} catch (MissingResourceException e) {
|
|
return "Archivo:"+BUNDLE_NAME+" no encontrado";
|
|
} catch (Throwable e) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static String getProperty(String pKey, Object... pParameters) {
|
|
try {
|
|
String msg = null;
|
|
try{
|
|
msg = RESOURCE_BUNDLE.getString(pKey);
|
|
}catch(Exception e){
|
|
|
|
}
|
|
if(msg == null){
|
|
msg = pKey;
|
|
}
|
|
return MessageFormat.format(msg, pParameters);
|
|
} catch (Throwable e) {
|
|
return null;
|
|
}
|
|
}
|
|
} |