/** * Populate all static {@link Option}-tagged fields in the given classes with the given Properties. * Then, fill in additional (or overwrite existing) properties with the given (String) command-line arguments. * Note that this may take a while if the classpath is large. * * @param props The properties to use to fill fields in the various classes. * @param args The command-line arguments to use to fill in additional properties. */ public static void fillOptions(Properties props, String... args) { //(convert to map) Properties allProperties = updatePropertiesWithOptions(props, args); //(bootstrap) Map<String, Field> bootstrapMap = fillOptionsImpl(null, BOOTSTRAP_CLASSES, allProperties, false, true); bootstrapMap.keySet().forEach(allProperties::remove); //(fill options) Class<?>[] visibleClasses = optionClasses; if (visibleClasses == null) { visibleClasses = getVisibleClasses(); } //get classes fillOptionsImpl(null, visibleClasses, allProperties); //fill }
/** * Populate all static {@link Option}-tagged fields in the given classes with the given Properties. * Then, fill in additional (or overwrite existing) properties with the given (String) command-line arguments. * Note that this may take a while if the classpath is large. * * @param props The properties to use to fill fields in the various classes. * @param args The command-line arguments to use to fill in additional properties. */ public static void fillOptions(Properties props, String... args) { //(convert to map) Properties allProperties = updatePropertiesWithOptions(props, args); //(bootstrap) Map<String, Field> bootstrapMap = fillOptionsImpl(null, BOOTSTRAP_CLASSES, allProperties, false, true); bootstrapMap.keySet().forEach(allProperties::remove); //(fill options) Class<?>[] visibleClasses = optionClasses; if (visibleClasses == null) { visibleClasses = getVisibleClasses(); } //get classes fillOptionsImpl(null, visibleClasses, allProperties); //fill }
/** * Populate all static {@link Option}-tagged fields in the given classes with the given Properties. * Then, fill in additional (or overwrite existing) properties with the given (String) command-line arguments. * Note that this may take a while if the classpath is large. * * @param props The properties to use to fill fields in the various classes. * @param args The command-line arguments to use to fill in additional properties. */ public static void fillOptions(Properties props, String... args) { //(convert to map) Properties allProperties = updatePropertiesWithOptions(props, args); //(bootstrap) Map<String, Field> bootstrapMap = fillOptionsImpl(null, BOOTSTRAP_CLASSES, allProperties, false, true); bootstrapMap.keySet().forEach(allProperties::remove); //(fill options) Class<?>[] visibleClasses = optionClasses; if (visibleClasses == null) { visibleClasses = getVisibleClasses(); } //get classes fillOptionsImpl(null, visibleClasses, allProperties); //fill }