Class LoaderUtils

java.lang.Object
io.jmix.flowui.kit.xml.layout.support.LoaderUtils

public final class LoaderUtils extends Object
Spring-independent helpers for reading typed values from XML attributes. Shared by the runtime component loaders in the flowui module and the Studio preview component loaders in flowui-kit.
  • Method Details

    • loadString

      public static Optional<String> loadString(org.dom4j.Element element, String attributeName)
    • loadString

      public static Optional<String> loadString(org.dom4j.Element element, String attributeName, boolean emptyToNull)
    • loadBoolean

      public static Optional<Boolean> loadBoolean(org.dom4j.Element element, String attributeName)
    • loadInteger

      public static Optional<Integer> loadInteger(org.dom4j.Element element, String attributeName)
    • loadDouble

      public static Optional<Double> loadDouble(org.dom4j.Element element, String attributeName)
    • loadEnum

      public static <T extends Enum<T>> Optional<T> loadEnum(org.dom4j.Element element, Class<T> type, String attributeName)
    • loadString

      public static void loadString(org.dom4j.Element element, String attributeName, Consumer<String> setter)
    • loadBoolean

      public static void loadBoolean(org.dom4j.Element element, String attributeName, Consumer<Boolean> setter)
    • loadInteger

      public static void loadInteger(org.dom4j.Element element, String attributeName, Consumer<Integer> setter)
    • loadDouble

      public static void loadDouble(org.dom4j.Element element, String attributeName, Consumer<Double> setter)
    • loadEnum

      public static <T extends Enum<T>> void loadEnum(org.dom4j.Element element, Class<T> type, String attributeName, Consumer<T> setter)
    • split

      public static void split(String names, Consumer<String> setter)
    • split

      public static List<String> split(String names)
    • applyCss

      public static void applyCss(String css, BiConsumer<String,String> setter)
      Parses CSS declarations separated by semicolons and passes every property to the given setter.
      Parameters:
      css - CSS declarations separated by semicolons
      setter - consumer of a property name and its value
      Throws:
      IllegalArgumentException - if a declaration has no separator or an empty property name