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
ConstructorDescriptionTranslateJsonSchema
(ClassLoader loader) Constructor which takes aClassLoader
where the String is defined. -
Method Summary
-
Constructor Details
-
TranslateJsonSchema
Constructor which takes aClassLoader
where the String is defined.- Parameters:
loader
- theClassLoader
where the translation resources are defined
-
-
Method Details
-
apply
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:
apply
in interfaceFunction<JsonValue,
JsonValue, NeverThrowsException> - Parameters:
value
- A JsonValue.- Returns:
- a transformed copy of the JsonValue input.
-