Index: lutinutil/src/java/org/codelutin/option/Config.java diff -u lutinutil/src/java/org/codelutin/option/Config.java:1.1 lutinutil/src/java/org/codelutin/option/Config.java:1.2 --- lutinutil/src/java/org/codelutin/option/Config.java:1.1 Sun Dec 30 22:50:46 2007 +++ lutinutil/src/java/org/codelutin/option/Config.java Tue Jan 1 17:26:18 2008 @@ -409,6 +409,44 @@ } /** + * + * @throws IOException if any + */ + protected void loadFromSource() throws IOException { + if (source != null) { + return; + } + load(source.toURL().openStream()); + } + + protected void loadFromDefaultValue() throws IOException { + for (ConfigPropertyKey propertyKey : universe) { + Object defaultValue = propertyKey.getDefaultValue(); + if (defaultValue != null) { + setProperty(propertyKey, defaultValue); + } + } + } + + protected void loadFromSystem() { + for (ConfigPropertyKey propertyKey : universe) { + Object val = System.getProperty(propertyKey.getKey()); + if (val != null) { + setProperty(propertyKey, val); + } + } + } + + protected void loadFromEnv() { + for (ConfigPropertyKey propertyKey : universe) { + Object val = System.getenv(propertyKey.getKey()); + if (val != null) { + setProperty(propertyKey, val); + } + } + } + + /** * Set a value for a given property using his def and update * also the list of keys used. *