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

Method setProperty

java/cli/src/main/java/cli/Main.java:171–193  ·  view source on GitHub ↗
(Exchange instance, String key, String value)

Source from the content-addressed store, hash-verified

169 }
170
171 private static void setProperty(Exchange instance, String key, String value)
172 throws IllegalArgumentException, IllegalAccessException {
173
174 Class<?> clazz = instance.getClass();
175 Field field = null;
176
177 // look for the field in this class and its superclasses
178 while (clazz != null) {
179 try {
180 field = clazz.getDeclaredField(key);
181 break; // found it
182 } catch (NoSuchFieldException e) {
183 clazz = clazz.getSuperclass(); // go up the hierarchy
184 }
185 }
186
187 if (field != null) {
188 field.setAccessible(true);
189 field.set(instance, value);
190 } else {
191 System.out.println("No field or setter found for credential: " + key);
192 }
193 }
194
195 public static Object callDynamic(Object instance, String methodName, Object... args) {
196 Class<?> clazz = instance.getClass();

Callers 1

setCredentialsMethod · 0.95

Calls 1

setMethod · 0.80

Tested by

no test coverage detected