/** * Populate all static options in the given class, as defined by the given properties. * Then, fill in additional (or overwrite existing) properties with the given (String) command-line arguments. * * @param clazz The class to populate static {@link Option}-tagged fields in. * @param props The properties to use to fill these fields. * @param args Additional command-line options to fill these fields. */ public static void fillOptions(Class<?> clazz, Properties props, String... args) { Properties allProperties = updatePropertiesWithOptions(props, args); fillOptionsImpl(null, new Class[]{ clazz }, allProperties); }
/** * Populate all static options in the given class, as defined by the given properties. * Then, fill in additional (or overwrite existing) properties with the given (String) command-line arguments. * * @param instance The object instance containing {@link Option}-tagged fields which we should fill. * @param props The properties to use to fill these fields. * @param args Additional command-line options to fill these fields. */ public static void fillOptions(Object instance, Properties props, String... args) { Properties allProperties = updatePropertiesWithOptions(props, args); fillOptions(new Object[]{ instance }, allProperties); }
/** * 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 options in the given class, as defined by the given properties. * Then, fill in additional (or overwrite existing) properties with the given (String) command-line arguments. * * @param clazz The class to populate static {@link Option}-tagged fields in. * @param props The properties to use to fill these fields. * @param args Additional command-line options to fill these fields. */ public static void fillOptions(Class<?> clazz, Properties props, String... args) { Properties allProperties = updatePropertiesWithOptions(props, args); fillOptionsImpl(null, new Class[]{ clazz }, allProperties); }
/** * Populate all static options in the given class, as defined by the given properties. * Then, fill in additional (or overwrite existing) properties with the given (String) command-line arguments. * * @param instance The object instance containing {@link Option}-tagged fields which we should fill. * @param props The properties to use to fill these fields. * @param args Additional command-line options to fill these fields. */ public static void fillOptions(Object instance, Properties props, String... args) { Properties allProperties = updatePropertiesWithOptions(props, args); fillOptions(new Object[]{ instance }, allProperties); }
/** * Populate all static options in the given class, as defined by the given properties. * Then, fill in additional (or overwrite existing) properties with the given (String) command-line arguments. * * @param clazz The class to populate static {@link Option}-tagged fields in. * @param props The properties to use to fill these fields. * @param args Additional command-line options to fill these fields. */ public static void fillOptions(Class<?> clazz, Properties props, String... args) { Properties allProperties = updatePropertiesWithOptions(props, args); fillOptionsImpl(null, new Class[]{ clazz }, allProperties); }
/** * Populate all static options in the given class, as defined by the given properties. * Then, fill in additional (or overwrite existing) properties with the given (String) command-line arguments. * * @param instance The object instance containing {@link Option}-tagged fields which we should fill. * @param props The properties to use to fill these fields. * @param args Additional command-line options to fill these fields. */ public static void fillOptions(Object instance, Properties props, String... args) { Properties allProperties = updatePropertiesWithOptions(props, args); fillOptions(new Object[]{ instance }, allProperties); }
/** * 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 }