Class XMLUtil
java.lang.Object
com.github.stefvanschie.inventoryframework.util.XMLUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
loadFieldAttribute(@NotNull Object instance, @NotNull Element element, @Nullable Object value)
Sets a field from the given instance and element to the specified valuestatic <T extends org.bukkit.event.Event>
@Nullable Consumer<T>loadOnEventAttribute(@NotNull Object instance, @NotNull Element element, @NotNull Class<T> eventType, @NotNull String name)
Loads an event consumer from the given instance and element
-
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 instanceelement
- the elementeventType
- the type of the eventname
- 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 inelement
- the element from which the field is specifiedvalue
- the field's new value
-