use of java.util.ResourceBundle in project head by mifos.
the class ViewStageTransactionActionForm method trxnDateValidate.
private ActionErrors trxnDateValidate(ActionErrors errors, Locale locale) {
if (StringUtils.isNotBlank(getStageTrxnDate()) && !DateUtils.isValidDate(getStageTrxnDate())) {
ResourceBundle resources = ResourceBundle.getBundle(FilePaths.SIMPLE_ACCOUNTING_RESOURCE, locale);
String trxnDate = resources.getString(SimpleAccountingConstants.TRXNDATE);
errors.add(SimpleAccountingConstants.INVALID_TRXN_DATE, new ActionMessage(SimpleAccountingConstants.INVALID_TRXN_DATE, trxnDate));
}
return errors;
}
use of java.util.ResourceBundle in project head by mifos.
the class InterOfficeTransferActionForm method trxnDateValidate.
private ActionErrors trxnDateValidate(ActionErrors errors, Locale locale) {
if (StringUtils.isNotBlank(getTrxnDate()) && !DateUtils.isValidDate(getTrxnDate())) {
ResourceBundle resources = ResourceBundle.getBundle(FilePaths.SIMPLE_ACCOUNTING_RESOURCE, locale);
String trxnDate = resources.getString(SimpleAccountingConstants.TRXNDATE);
errors.add(SimpleAccountingConstants.INVALID_TRXN_DATE, new ActionMessage(SimpleAccountingConstants.INVALID_TRXN_DATE, trxnDate));
}
return errors;
}
use of java.util.ResourceBundle in project head by mifos.
the class MifosImageTag method doStartTag.
/**
* Function to render the tag
*
* @throws JspException
*/
@Override
public int doStartTag() throws JspException {
JspWriter out = pageContext.getOut();
ResourceBundle resource = getResourceBundle();
path = resource.getString(getId());
try {
out.println(render());
} catch (IOException e) {
e.printStackTrace();
}
return SKIP_BODY;
}
use of java.util.ResourceBundle in project jscs-plugin by idok.
the class JscsBundle method getBundle.
private static ResourceBundle getBundle() {
ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle);
if (bundle == null) {
bundle = ResourceBundle.getBundle(BUNDLE);
ourBundle = new SoftReference<ResourceBundle>(bundle);
}
return bundle;
}
use of java.util.ResourceBundle in project jodd by oblac.
the class ResourceBundleMessageResolver method findResourceBundle.
/**
* Finds resource bundle by it's name. Missed and founded resource bundles are cached for
* better performances. Returns <code>null</code> if resource bundle is missing.
*/
public ResourceBundle findResourceBundle(String bundleName, Locale locale) {
if (bundleName == null) {
bundleName = fallbackBundlename;
}
if (locale == null) {
locale = fallbackLocale;
}
if (!cacheResourceBundles) {
try {
return getBundle(bundleName, locale, ClassLoaderUtil.getDefaultClassLoader());
} catch (MissingResourceException ignore) {
return null;
}
}
String key = bundleName + '_' + LocaleUtil.resolveLocaleCode(locale);
try {
if (!misses.contains(key)) {
ResourceBundle bundle = notmisses.get(key);
if (bundle == null) {
bundle = getBundle(bundleName, locale, ClassLoaderUtil.getDefaultClassLoader());
notmisses.put(key, bundle);
}
return bundle;
}
} catch (MissingResourceException ignore) {
misses.add(key);
}
return null;
}
Aggregations