private NamingStrategy loadNamingStrategy()

in geronimo-openapi-impl/src/main/java/org/apache/geronimo/microprofile/openapi/cdi/GeronimoOpenAPIExtension.java [100:115]


    private NamingStrategy loadNamingStrategy(final GeronimoOpenAPIConfig config) {
        return ofNullable(config.read("model.operation.naming.strategy", null))
                .map(String::trim)
                .filter(it -> !it.isEmpty())
                .map(it -> {
                    try {
                        return Thread.currentThread().getContextClassLoader().loadClass(it).getConstructor().newInstance();
                    } catch (final InstantiationException | IllegalAccessException | NoSuchMethodException | ClassNotFoundException e) {
                        throw new IllegalArgumentException(e);
                    } catch (final InvocationTargetException ite) {
                        throw new IllegalArgumentException(ite.getTargetException());
                    }
                })
                .map(NamingStrategy.class::cast)
                .orElseGet(NamingStrategy.Default::new);
    }