private void initOptions(CommandLine cl) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, ParseException {
        Class cla = properties.getClass();
        Field[] fields = cla.getDeclaredFields();
        for(Field field:fields){
            String name = field.getName();
            String value = cl.getOptionValue(name);
            OptionRequired optionRequired = field.getAnnotation(OptionRequired.class);
            if(optionRequired != null){
                if(optionRequired.required()&&StringUtils.isBlank(value)){
                    throw new RuntimeException(String.format("parameters of %s is required",name));
                }
            }
            if(StringUtils.isNotBlank(value)){
                field.setAccessible(true);
                field.set(properties,value);
            }
        }
    }
The Parser of Launcher commandline options

Company: www.dtstack.com
@author sishu.yss
core/src/main/java/com/dtstack/flink/sql/option/OptionParser.java