Class StylesJsonBlueprintUtils

java.lang.Object
technology.sola.engine.graphics.gui.json.styles.StylesJsonBlueprintUtils

@NullMarked public class StylesJsonBlueprintUtils extends Object
A collection of common JsonElementparsing methods for use by StylesJsonValueParsers.
  • Method Details

    • parseString

      public static @Nullable String parseString(technology.sola.json.JsonElement value)
      Parses a String or null value from a JsonElement.
      Parameters:
      value - the JsonElement to parse
      Returns:
      the parsed String or null
    • parseInteger

      public static @Nullable Integer parseInteger(technology.sola.json.JsonElement value)
      Parses an Integer or null value from a JsonElement.
      Parameters:
      value - the JsonElement to parse
      Returns:
      the parsed Integer or null
    • parseStyleValueAsString

      public static @Nullable String parseStyleValueAsString(technology.sola.json.JsonElement value)
      Parses a valid StyleValue value as a string or null from a JsonElement.
      Parameters:
      value - the JsonElement to parse
      Returns:
      a valid StyleValue as a string or null
    • parseColor

      public static @Nullable Color parseColor(technology.sola.json.JsonElement value)
      Parses a Color from a JsonElement.

      Valid formats:

      • rgb(int, int, int)
      • argb(int, int, int, int)
      • #rrggbb
      • #aarrggbb
      Parameters:
      value - the JsonElement to parse
      Returns:
      the parsed Color or null