/** * Factory method to read the message with code <code>code</code> from the resource bundle. * * @param bundlePath complete path to the resource bundle for lookup * @param code numeric code of the message * @param arg * @return formatted error message as {@link String} */ protected String getString(String bundlePath, int code, Object arg) { Object[] arguments = new Object[] {arg}; return getString(bundlePath, code, arguments); }
/** * Factory method to read the message with code <code>code</code> from the resource bundle. * * @param bundlePath complete path to the resource bundle for lookup * @param code numeric code of the message * @return formatted error message as {@link String} */ protected String getString(String bundlePath, int code) { return getString(bundlePath, code, null); }
/** * Factory method to read the message with code <code>code</code> from the resource bundle. * * @param bundlePath complete path to the resource bundle for lookup * @param code numeric code of the message * @param arg1 * @param arg2 * @return formatted error message as {@link String} */ protected String getString(String bundlePath, int code, Object arg1, Object arg2) { Object[] arguments = new Object[] {arg1, arg2}; return getString(bundlePath, code, arguments); }
protected static String getString(String bundlePath, String code) { return MessageFactory.getString(bundlePath, Integer.parseInt(code)); } }
protected String getString(String bundlePath, String code) { return super.getString(bundlePath, Integer.parseInt(code)); }
/** * Factory method to create a new {@link Message} instance that is filled with the formatted * message with id <code>code</code> from the resource bundle <code>bundlePath</code>. * * @param bundlePath complete path to the resource bundle for lookup * @param code numeric code of the message */ protected Message createMessage(String bundlePath, int code) { String messageString = getString(bundlePath, code, null); return new Message(messageString, code, EMPTY_ARGS); }
/** * Factory method to create a new {@link Message} instance that is filled with the formatted * message with id <code>code</code> from the resource bundle <code>bundlePath</code>. * * <b>Attention:</b> do not confuse this method with * <code>createMessage(String, int, Object)</code>. * * @param bundlePath complete path to the resource bundle for lookup * @param code numeric code of the message * @param arguments * @see #getBundlePath(String) */ protected Message createMessage(String bundlePath, int code, Object... arguments) { String messageString = getString(bundlePath, code, arguments); return new Message(messageString, code, arguments); }