File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/main/java/at/jddev0/lang Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -3996,6 +3996,18 @@ public InterpretingError getAndClearErrnoErrorObject(final int SCOPE_ID) {
39963996 public void addPredefinedFunction (String funcName , LangNativeFunction function ) {
39973997 interpreter .funcs .put (funcName , function );
39983998 }
3999+ /**
4000+ * Adds all static methods which are annotated with @LangFunction the object contains
4001+ */
4002+ public void addPredefinedFunctions (Class <?> clazz ) {
4003+ interpreter .funcs .putAll (LangNativeFunction .getLangFunctionsOfClass (interpreter , clazz ));
4004+ }
4005+ /**
4006+ * Adds all non-static methods which are annotated with @LangFunction the object contains
4007+ */
4008+ public void addPredefinedFunctions (Object obj ) {
4009+ interpreter .funcs .putAll (LangNativeFunction .getLangFunctionsFromObject (interpreter , obj ));
4010+ }
39994011 /**
40004012 * Creates a function which is accessible globally in the Interpreter (= in all SCOPE_IDs)<br>
40014013 * If function already exists, it will be overridden<br>
You can’t perform that action at this time.
0 commit comments