@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return MethodUtils.invokeMethod(getProductOptionValuesCollection(), method.getName(), args, method.getParameterTypes()); } });
MethodUtils.invokeMethod(parent, methodName, new Object[]{ child }, paramTypes);
MethodUtils.invokeMethod(parent, methodName, new Object[]{ child }, paramTypes);
MethodUtils.invokeMethod(child, methodName, new Object[]{ parent }, paramTypes);
result = MethodUtils.invokeMethod(target, methodName, paramValues, paramTypes);
returnValue = MethodUtils.invokeMethod(value, method.getName(), args, parameterTypes);
return invokeMethod(object, methodName, args); parameterTypes[i] = args[i].getClass(); return invokeMethod(object, methodName, args, parameterTypes);
return invokeMethod(object, methodName, args); parameterTypes[i] = args[i].getClass(); return invokeMethod(object, methodName, args, parameterTypes);
private void updateReaderWithAuxiliaryPath( Hints hints, ImageReader reader, Key key, String method) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { String filePath = (String) hints.get(key); if (filePath != null && hints.containsKey(Utils.PARENT_DIR)) { String parentDir = (String) hints.get(Utils.PARENT_DIR); // check if the file is not already absolute (old configuration file) if (!new File(filePath).isAbsolute()) { filePath = parentDir + File.separatorChar + filePath; } } if (filePath != null) { MethodUtils.invokeMethod(reader, method, filePath); } }
private boolean customizeReaderInitialization(ImageReader reader, Hints hints) { // Special Management for NetCDF readers to set external Auxiliary File if (hints != null && (hints.containsKey(Utils.AUXILIARY_FILES_PATH) || hints.containsKey(Utils.AUXILIARY_DATASTORE_PATH))) { try { updateReaderWithAuxiliaryPath( hints, reader, Utils.AUXILIARY_FILES_PATH, "setAuxiliaryFilesPath"); updateReaderWithAuxiliaryPath( hints, reader, Utils.AUXILIARY_DATASTORE_PATH, "setAuxiliaryDatastorePath"); if (hints.get(Hints.REPOSITORY) != null && MethodUtils.getAccessibleMethod( reader.getClass(), "setRepository", new Class[] {Repository.class}) != null) { MethodUtils.invokeMethod(reader, "setRepository", hints.get(Hints.REPOSITORY)); } return true; } catch (NoSuchMethodException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } } return false; }
/** * 调用克隆方法 * @param object * @return * @throws Exception */ public static Object clone(Object object) throws Exception{ return MethodUtils.invokeMethod(object, "clone", null); }
public void destroy() { try { MethodUtils.invokeMethod(bus, "shutdown", Boolean.TRUE); } catch (Exception e) { log.error("Failed to destroy jaxrs bus.", e); } }
public void destroy() { try { MethodUtils.invokeMethod(bus, "shutdown", Boolean.TRUE); } catch (Exception e) { log.error("Failed to destroy jaxrs bus.", e); } }
!= null) { try { MethodUtils.invokeMethod(reader, "setRasterLayerRequest", request); } catch (Exception exception) { throw new RuntimeException(
private Object invokeExtensionMethod(IComponentExtension<? extends IComponent> componentExtension, Method method, Object... args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { return MethodUtils.invokeMethod(componentExtension, method.getName(), args, method.getParameterTypes()); }
private Object evaluate(Object obj, Method method, Object[] arguments) throws IllegalAccessException, InvocationTargetException { // direct method call if (method.getDeclaringClass().isAssignableFrom(obj.getClass())) { return method.invoke(obj, arguments); } // ducking try { return MethodUtils.invokeMethod(obj, method.getName(), arguments); } catch (NoSuchMethodException e) { return null; } } }
/** * Invoke the request on the target. * * @param request The request to invoke. */ private void invokeRequest(InvocationRequest request) { try { MethodUtils.invokeMethod(target, request.getMethodName(), request.getArgs()); } catch (Exception e) { log.error("Remote invocation error.", e); } }
public static Object executeClassMethod(Object object, String methodName, Object[] parameters) throws Exception { Method method = getMethodByName(object, methodName, parameters); //如果有缓冲,则用缓冲方式调用 if (method != null) { return method.invoke(object, parameters); } if (object instanceof StaticClassOperator) { return ((StaticClassOperator) object).invokeStaticMethod(methodName, parameters); } else { return MethodUtils.invokeMethod(object, methodName, parameters); } }
@Override public void begin( String namespace, String name, Attributes attributes ) throws Exception { Digester digester = getDigester(); digester.push( MethodUtils.invokeMethod( digester.peek(), method, NO_PARAMS ) ); }
@Override public void begin( String namespace, String name, Attributes attributes ) throws Exception { Digester digester = getDigester(); digester.push( MethodUtils.invokeMethod( digester.peek(), method, NO_PARAMS ) ); }