Package org.scf4j.props

Examples of org.scf4j.props.PropertyConfigurator


    File configRoot = new File(args[0]);
    if (!configRoot.exists() || !configRoot.isDirectory()) {
      usage();
    }

    PropertyConfigurator configurator = new PropertyConfigurator();
    configurator.setConfigurationRoot(configRoot);

    try {
      Config config = configurator.getConfiguration(Config.class);

      System.out.println("Your configuration is: ");
      System.out.println("\tnestedProp.string: " + config.getNested().getString());
      System.out.println("\tnestedProp.int:    " + config.getNested().getInt());
    } catch (ConfigurationException e) {
View Full Code Here


    File configRoot = new File(args[0]);
    if (!configRoot.exists() || !configRoot.isDirectory()) {
      usage();
    }

    PropertyConfigurator configurator = new PropertyConfigurator();
    configurator.setConfigurationRoot(configRoot);
    configurator.setTypeCoercer(new MyTypeCoercer());

    try {
      Config config = configurator.getConfiguration(Config.class);

      System.out.println("Your configuration is: ");
      System.out.println("\tdate:   " + config.getDate());
      System.out.println("\tdouble: " + config.getDouble());
    } catch (ConfigurationException e) {
View Full Code Here

TOP

Related Classes of org.scf4j.props.PropertyConfigurator

Copyright © 2018 www.massapicom. 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.