Class LoaderSupport

java.lang.Object
io.jmix.flowui.xml.layout.support.LoaderSupport

@Component("flowui_LoaderSupport") public class LoaderSupport extends Object
Facilitates parsing data from XML.
  • Field Details

  • Constructor Details

    • LoaderSupport

      public LoaderSupport(MessageTools messageTools)
  • Method Details

    • loadString

      public Optional<String> loadString(org.dom4j.Element element, String attributeName)
      Returns an Optional with the attribute value from the given element for the attribute with the given name, otherwise an empty Optional. Also returns an empty Optional if the attribute value is the empty string.
      Parameters:
      element - the element to obtain value
      attributeName - the name of the attribute value to be returned
      Returns:
      an Optional with a present String value if the specified attribute exists in the element, otherwise an empty Optional
    • loadString

      public Optional<String> loadString(org.dom4j.Element element, String attributeName, boolean emptyToNull)
      Returns an Optional with the attribute value from the given element for the attribute with the given name, otherwise an empty Optional.
      Parameters:
      element - the element to obtain value
      attributeName - the name of the attribute value to be returned
      emptyToNull - whether to return an empty Optional for empty string
      Returns:
      an Optional with a present String value if the specified attribute exists in the element, otherwise an empty Optional
    • loadBoolean

      public Optional<Boolean> loadBoolean(org.dom4j.Element element, String attributeName)
      Returns an Optional with the attribute value from the given element for the attribute with the given name, otherwise an empty Optional.
      Parameters:
      element - the element to obtain value
      attributeName - the name of the attribute value to be returned
      Returns:
      an Optional with a present Boolean value if the specified attribute exists in the element, otherwise an empty Optional
    • loadInteger

      public Optional<Integer> loadInteger(org.dom4j.Element element, String attributeName)
      Returns an Optional with the attribute value from the given element for the attribute with the given name, otherwise an empty Optional.
      Parameters:
      element - the element to obtain value
      attributeName - the name of the attribute value to be returned
      Returns:
      an Optional with a present Integer value if the specified attribute exists in the element, otherwise an empty Optional
    • loadDouble

      public Optional<Double> loadDouble(org.dom4j.Element element, String attributeName)
      Returns an Optional with the attribute value from the given element for the attribute with the given name, otherwise an empty Optional.
      Parameters:
      element - the element to obtain value
      attributeName - the name of the attribute value to be returned
      Returns:
      an Optional with a present Double value if the specified attribute exists in the element, otherwise an empty Optional
    • loadEnum

      public <T extends Enum<T>> Optional<T> loadEnum(org.dom4j.Element element, Class<T> type, String attributeName)
      Returns an Optional with the attribute value from the given element for the attribute with the given name, otherwise an empty Optional.
      Parameters:
      element - the element to obtain value
      type - the enum type to be converted to
      attributeName - the name of the attribute value to be returned
      Returns:
      an Optional with a present Enum value if the specified attribute exists in the element, otherwise an empty Optional
    • loadResourceString

      public Optional<String> loadResourceString(org.dom4j.Element element, String attributeName, String messageGroup)
      Returns an Optional with the localized message defined in the attribute value from the given element for the attribute with the given name, otherwise an empty Optional. Also returns an empty Optional if the attribute value is the empty string.
      Parameters:
      element - the element to obtain value
      attributeName - the name of the attribute value to be returned
      messageGroup - message group to use
      Returns:
      an Optional with a present localized String value if the specified attribute exists in the element, otherwise an empty Optional
    • loadResourceString

      public Optional<String> loadResourceString(org.dom4j.Element element, String attributeName, String messageGroup, boolean emptyToNull)
      Returns an Optional with the localized message defined in the attribute value from the given element for the attribute with the given name, otherwise an empty Optional.
      Parameters:
      element - the element to obtain value
      attributeName - the name of the attribute value to be returned
      messageGroup - message group to use
      emptyToNull - whether to return an empty Optional for empty string
      Returns:
      an Optional with a present localized String value if the specified attribute exists in the element, otherwise an empty Optional
    • loadString

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

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

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

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

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

      public void loadResourceString(org.dom4j.Element element, String attributeName, String messageGroup, Consumer<String> setter)
    • loadResourceString

      @Nullable protected String loadResourceString(@Nullable String message, String messageGroup)