Interface JavaWrapper
@Info("Methods for working with Java classes. Reflection my beloved \u2665")
public interface JavaWrapper
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T> Tstatic ConsoleJScreateConsole(KubeJSContext cx, String name) static ObjectloadClass(KubeJSContext cx, String className) static <T> TmakeFunctionProxy(dev.latvian.mods.rhino.Context cx, dev.latvian.mods.rhino.type.TypeInfo targetClass, dev.latvian.mods.rhino.BaseFunction function) static <R extends Record>
RmergeRecord(dev.latvian.mods.rhino.Context cx, R original, Map<String, ?> merge) static @Nullable ObjecttryLoadClass(KubeJSContext cx, String className) static @Nullable Class<?> tryLoadClass(String className)
-
Method Details
-
loadClass
@Info("Loads the specified class, and throws error if class it not found or allowed.\nThe returned object can have public static methods and fields accessed directly from it.\nConstructors can be used with the new keyword.\n") static Object loadClass(KubeJSContext cx, String className) -
tryLoadClass
@Info("Loads the specified class, and returns null if class is not found or allowed.\nThe returned object can have public static methods and fields accessed directly from it.\nConstructors can be used with the new keyword.\n") @Nullable static @Nullable Object tryLoadClass(KubeJSContext cx, String className) -
createConsole
@Info("Creates a custom ConsoleJS instance for you to use to, well, log stuff") static ConsoleJS createConsole(KubeJSContext cx, String name) -
makeFunctionProxy
static <T> T makeFunctionProxy(dev.latvian.mods.rhino.Context cx, dev.latvian.mods.rhino.type.TypeInfo targetClass, dev.latvian.mods.rhino.BaseFunction function) -
cast
-
tryLoadClass
-
mergeRecord
-