/** * Associates an default value {@code node}. * The value will be used alongside a key to resolve a message via the application's {@code MessageSource}. * * @param node the target node on which the key will be registered. * @param defaultValue the value to be registered. * * @since 2.11.0 */ public static void setI18nDefaultValue(@Nonnull Axis<?> node, @Nullable String defaultValue) { requireNonNull(node, ERROR_NODE_NULL); node.getProperties().put(MessageSource.class.getName() + SUFFIX_DEFAULT_VALUE, defaultValue); }
/** * Finds out if an {@code arguments array} has been registered with the target {@code Node}, returning the array if found. * * @param node the target node on which the arguments may have been registered. * * @return the arguments registered with the target {@code Node} or {@code null} if not found. * * @since 2.11.0 */ @Nullable public static String getI18nArgs(@Nonnull Axis<?> node) { requireNonNull(node, ERROR_NODE_NULL); return (String) node.getProperties().get(MessageSource.class.getName() + SUFFIX_ARGS); }
/** * Finds out if an i18n {@code key} has been registered with the target {@code Node}, returning the key if found. * * @param node the target node on which the key may have been registered. * * @return the key registered with the target {@code Node} or {@code null} if not found. * * @since 2.11.0 */ @Nullable public static String getI18nKey(@Nonnull Axis<?> node) { requireNonNull(node, ERROR_NODE_NULL); return (String) node.getProperties().get(MessageSource.class.getName() + SUFFIX_KEY); }
/** * Finds out if a {@code default value} has been registered with the target {@code Node}, returning the value if found. * * @param node the target node on which the value may have been registered. * * @return the value registered with the target {@code Node} or {@code null} if not found. * * @since 2.11.0 */ @Nullable public static String getI18nDefaultValue(@Nonnull Axis<?> node) { requireNonNull(node, ERROR_NODE_NULL); return (String) node.getProperties().get(MessageSource.class.getName() + SUFFIX_DEFAULT_VALUE); }
/** * Associates an i18n key to a {@code node}. The key is used to resolve a message via the application's {@code MessageSource}. * * @param node the target node on which the key will be registered. * @param key the message key to be registered. * * @since 2.11.0 */ public static void setI18nKey(@Nonnull Axis<?> node, @Nonnull String key) { requireNonNull(node, ERROR_NODE_NULL); requireNonBlank(key, ERROR_KEY_BLANK); node.getProperties().put(MessageSource.class.getName() + SUFFIX_KEY, key); }
/** * Associates an i18n arrays of arguments to a {@code node}. * These arguments will be used alongside a key to resolve a message via the application's {@code MessageSource}. * * @param node the target node on which the key will be registered. * @param args the array of arguments to be registered. * * @since 2.11.0 */ public static void setI18nArgs(@Nonnull Axis<?> node, @Nullable String args) { requireNonNull(node, ERROR_NODE_NULL); requireNonBlank(args, ERROR_ARGS_BLANK); node.getProperties().put(MessageSource.class.getName() + SUFFIX_ARGS, args); }