java.lang.Object
com.github.stefvanschie.inventoryframework.util.XMLUtil

public class XMLUtil extends Object
  • Constructor Details

    • XMLUtil

      public XMLUtil()
  • Method Details

    • loadOnEventAttribute

      @Nullable @Contract(pure=true) public static <T extends org.bukkit.event.Event> @Nullable Consumer<T> loadOnEventAttribute(@NotNull @NotNull Object instance, @NotNull @NotNull Element element, @NotNull @NotNull Class<T> eventType, @NotNull @NotNull String name)
      Loads an event consumer from the given instance and element
      Type Parameters:
      T - the type of the event
      Parameters:
      instance - the object instance
      element - the element
      eventType - the type of the event
      name - the name of the attribute
      Returns:
      the consumer to be called on click
    • loadFieldAttribute

      public static void loadFieldAttribute(@NotNull @NotNull Object instance, @NotNull @NotNull Element element, @Nullable @Nullable Object value)
      Sets a field from the given instance and element to the specified value
      Parameters:
      instance - the class instance the field is located in
      element - the element from which the field is specified
      value - the field's new value