Examples of JOptCommandLinePropertySource


Examples of org.springframework.core.env.JOptCommandLinePropertySource

  public static void main(String... args) {
    OptionParser parser = new OptionParser();
    parser.accepts("greeting").withRequiredArg();
    OptionSet options = parser.parse(args);
    PropertySource<?> ps = new JOptCommandLinePropertySource(options);

    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
    ctx.getEnvironment().getPropertySources().addLast(ps);
    ctx.register(Greeter.class);
    ctx.refresh();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.