Package org.forgerock.api.models
Class TranslateJsonSchema
- java.lang.Object
-
- org.forgerock.api.models.TranslateJsonSchema
-
- All Implemented Interfaces:
Function<JsonValue,JsonValue,NeverThrowsException>
public class TranslateJsonSchema extends Object implements Function<JsonValue,JsonValue,NeverThrowsException>
Iterates over each JsonValue node in the JsonValue structure and if it's a String marked for translation, It replaces the String with a LocalizableString.
-
-
Constructor Summary
Constructors Constructor Description TranslateJsonSchema(ClassLoader loader)Constructor which takes aClassLoaderwhere the String is defined.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonValueapply(JsonValue value)Applies the translation to string values by converting them toLocalizableString.
-
-
-
Constructor Detail
-
TranslateJsonSchema
public TranslateJsonSchema(ClassLoader loader)
Constructor which takes aClassLoaderwhere the String is defined.- Parameters:
loader- theClassLoaderwhere the translation resources are defined
-
-
Method Detail
-
apply
public JsonValue apply(JsonValue value)
Applies the translation to string values by converting them toLocalizableString. It traverses the JsonValue structure, iteratively applying the function to each item in a collection.- Specified by:
applyin interfaceFunction<JsonValue,JsonValue,NeverThrowsException>- Parameters:
value- A JsonValue.- Returns:
- a transformed copy of the JsonValue input.
-
-