private String findFieldName()

in geronimo-openapi-impl/src/main/java/org/apache/geronimo/microprofile/openapi/impl/processor/SchemaProcessor.java [312:341]


    private String findFieldName(final Field f) {
        return findSchemaName(f)
                .orElseGet(() -> {
                    if (f.isAnnotationPresent(JsonbProperty.class)) {
                        return f.getAnnotation(JsonbProperty.class).value();
                    }
                    // getter
                    final String fName = f.getName();
                    final String subName = Character.toUpperCase(fName.charAt(0))
                            + (fName.length() > 1 ? fName.substring(1) : "");
                    try {
                        final Method getter = f.getDeclaringClass().getMethod("get" + subName);
                        if (getter.isAnnotationPresent(JsonbProperty.class)) {
                            return getter.getAnnotation(JsonbProperty.class).value();
                        }
                    } catch (final NoSuchMethodException e) {
                        if (boolean.class == f.getType()) {
                            try {
                                final Method isser = f.getDeclaringClass().getMethod("is" + subName);
                                if (isser.isAnnotationPresent(JsonbProperty.class)) {
                                    return isser.getAnnotation(JsonbProperty.class).value();
                                }
                            } catch (final NoSuchMethodException e2) {
                                // no-op
                            }
                        }
                    }
                    return fName;
                });
    }