/** * Create a new ConfigMethod implementation appropriate for handling a * configuration interface method. * * @param configInterface The configuration interface. * @param method The method. * @return The method implementation. */ private static ConfigMethod newInstance(Class<?> configInterface, Method method) { for (ConfigMethod.Factory factory : CONFIG_METHOD_FACTORIES) { if (factory.canHandle(method)) { return factory.newInstance(configInterface, method); } } throw new RuntimeException("Invalid config interface method: " + method); }