public TemplateModel create(Object object, ObjectWrapper wrapper) { return new ResourceBundleModel((ResourceBundle) object, (BeansWrapper) wrapper); } };
String key = unwrap((TemplateModel) it.next()).toString(); try { if (!it.hasNext()) { return wrap(((ResourceBundle) object).getObject(key)); Object[] params = new Object[args]; for (int i = 0; i < args; ++i) params[i] = unwrap((TemplateModel) it.next()); return new StringModel(format(key, params), wrapper); } catch (MissingResourceException e) { throw new TemplateModelException("No such key: " + key);
if (format == null) { format = new MessageFormat(((ResourceBundle) object).getString(key)); format.setLocale(getBundle().getLocale()); formats.put(key, format);
@Override public int size() { return keySet().size(); }
/** * Overridden to invoke the getObject method of the resource bundle. */ @Override protected TemplateModel invokeGenericGet(Map keyMap, Class clazz, String key) throws TemplateModelException { try { return wrap(((ResourceBundle) object).getObject(key)); } catch (MissingResourceException e) { throw new _TemplateModelException(e, "No ", new _DelayedJQuote(key), " key in the ResourceBundle. " + "Note that conforming to the ResourceBundle Java API, this is an error and not just " + "a missing sub-variable (a null)."); } }
public int size() { return keySet().size(); }
/** * Overridden to invoke the getObject method of the resource bundle. */ protected TemplateModel invokeGenericGet(Map keyMap, Class clazz, String key) throws TemplateModelException { try { return wrap(((ResourceBundle)object).getObject(key)); } catch(MissingResourceException e) { throw new TemplateModelException("No such key: " + key); } }
String key = unwrap((TemplateModel) it.next()).toString(); try { if (!it.hasNext()) { return wrap(((ResourceBundle) object).getObject(key)); Object[] params = new Object[args]; for (int i = 0; i < args; ++i) params[i] = unwrap((TemplateModel) it.next()); return new StringModel(format(key, params), wrapper); } catch (MissingResourceException e) { throw new TemplateModelException("No such key: " + key);
public TemplateModel create(Object object, ObjectWrapper wrapper) { return new ResourceBundleModel((ResourceBundle)object, (BeansWrapper)wrapper); } };
@Override public int size() { return keySet().size(); }
/** * Overridden to invoke the getObject method of the resource bundle. */ @Override protected TemplateModel invokeGenericGet(Map keyMap, Class clazz, String key) throws TemplateModelException { try { return wrap(((ResourceBundle) object).getObject(key)); } catch (MissingResourceException e) { throw new _TemplateModelException(e, "No ", new _DelayedJQuote(key), " key in the ResourceBundle. " + "Note that conforming to the ResourceBundle Java API, this is an error and not just " + "a missing sub-variable (a null)."); } }
if (format == null) { format = new MessageFormat(((ResourceBundle) object).getString(key)); format.setLocale(getBundle().getLocale()); formats.put(key, format);
String key = unwrap((TemplateModel) it.next()).toString(); try { if (!it.hasNext()) { return wrap(((ResourceBundle) object).getObject(key)); Object[] params = new Object[args]; for (int i = 0; i < args; ++i) params[i] = unwrap((TemplateModel) it.next()); return new StringModel(format(key, params), wrapper); } catch (MissingResourceException e) { throw new TemplateModelException("No such key: " + key);
public TemplateModel create(Object object, ObjectWrapper wrapper) { return new ResourceBundleModel((ResourceBundle) object, (BeansWrapper) wrapper); } };
@Override public int size() { return keySet().size(); }
/** * Overridden to invoke the getObject method of the resource bundle. */ @Override protected TemplateModel invokeGenericGet(Map keyMap, Class clazz, String key) throws TemplateModelException { try { return wrap(((ResourceBundle) object).getObject(key)); } catch (MissingResourceException e) { throw new _TemplateModelException(e, "No ", new _DelayedJQuote(key), " key in the ResourceBundle. " + "Note that conforming to the ResourceBundle Java API, this is an error and not just " + "a missing sub-variable (a null)."); } }
if (format == null) { format = new MessageFormat(((ResourceBundle) object).getString(key)); format.setLocale(getBundle().getLocale()); formats.put(key, format);
public TemplateModel create(Object object, ObjectWrapper wrapper) { return new ResourceBundleModel((ResourceBundle) object, (BeansWrapper) wrapper); } };
format.setLocale(getBundle().getLocale()); formats.put(key, format);