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 Details

    • TranslateJsonSchema

      public TranslateJsonSchema(ClassLoader loader)
      Constructor which takes a ClassLoader where the String is defined.
      Parameters:
      loader - the ClassLoader where the translation resources are defined
  • Method Details

    • apply

      public JsonValue apply(JsonValue value)
      Applies the translation to string values by converting them to LocalizableString. It traverses the JsonValue structure, iteratively applying the function to each item in a collection.
      Specified by:
      apply in interface Function<JsonValue,JsonValue,NeverThrowsException>
      Parameters:
      value - A JsonValue.
      Returns:
      a transformed copy of the JsonValue input.