private static List<?> extractConstantFieldValue(FieldScope field) {
        if (!field.isStatic() || !field.isFinal()) {
            return null;
        }
        if (field.isFakeContainerItemScope() || field.getRawMember().isEnumConstant()) {
            return null;
        }
        Field rawField = field.getRawMember();
        try {
            return Collections.singletonList(rawField.get(null));
        } catch (IllegalAccessException ex) {
            // let's try to make it accessible then
        }
        try {
            rawField.setAccessible(true);
            return Collections.singletonList(rawField.get(null));
        } catch (SecurityException | IllegalAccessException ex) {
            // if the field cannot be accessed, we just can't extract any constant value
            return null;
        }
    }
Look-up the given field's constant (i.e. final static) value, or return null.

@param field targeted field
@return collection containing single constant value; returning null if field has no constant value
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/module/ConstantValueModule.java