private NamingStrategy loadNamingStrategy()

in geronimo-openapi-maven-plugin/src/main/java/org/apache/geronimo/microprofile/openapi/mojo/OpenAPIMojo.java [209:224]


    private NamingStrategy loadNamingStrategy() {
        return ofNullable(operationNamingStrategy)
                .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);
    }