MCPcopy Index your code
hub / github.com/ccxt/ccxt / callDynamically

Method callDynamically

java/lib/src/main/java/io/github/ccxt/Helpers.java:660–677  ·  view source on GitHub ↗
(Object obj, Object methodName, Object[] args)

Source from the content-addressed store, hash-verified

658
659
660public static Object callDynamically(Object obj, Object methodName, Object[] args) {
661 if (args == null) args = new Object[]{};
662
663 String name = (String) methodName;
664 Method m = findMethod(obj.getClass(), name, args.length);
665
666 try {
667 m.setAccessible(true);
668
669 Object[] invokeArgs = adaptForVarArgs(m, args);
670 coerceArgs(m, invokeArgs);
671
672 return m.invoke(obj, invokeArgs);
673
674 } catch (Exception e) {
675 throw new RuntimeException(e);
676 }
677}
678
679/**
680 * Coerce arguments to match the method's parameter types.

Callers 15

mainMethod · 0.95
mainMethod · 0.95
watchMethod · 0.95
testMethod · 0.95
testWatchTickerMethod · 0.95
testWatchTradesMethod · 0.95
testPublicMethod · 0.95
testPublicMultiSymbolMethod · 0.95
testPrivateMethod · 0.95
testPrivateAuthMethod · 0.95
scheduleCallbackMethod · 0.95

Calls 3

findMethodMethod · 0.95
adaptForVarArgsMethod · 0.95
coerceArgsMethod · 0.95

Tested by 13

mainMethod · 0.76
mainMethod · 0.76
watchMethod · 0.76
testMethod · 0.76
testWatchTickerMethod · 0.76
testWatchTradesMethod · 0.76
testPublicMethod · 0.76
testPublicMultiSymbolMethod · 0.76
testPrivateMethod · 0.76
testPrivateAuthMethod · 0.76
fetchOrderMethod · 0.76