private static <T> Object configField(Class<T> clazz, Properties properties, Parameter param, Config config) {
        final String serialized;
        if (properties.containsKey(config.name())) {
            serialized = properties.getProperty(config.name());
        } else {
            serialized = config.value();
        }

        final Class<?> type = param.getType();
        return parse(type, serialized).orElseThrow(() -> new IllegalArgumentException(String.format(
            "Unsupported type '%s' injected into the " +
                "constructor of class '%s'.",
            type.getName(), clazz.getName()
        )));

    }
Some common utility methods for analyzing classes with reflection.

@author Emil Forslund
@since 1.0.0
common-parent/injector/src/main/java/com/speedment/common/injector/internal/util/ReflectionUtil.java