[Lutinutil-commits] r913 - trunk/commandline/commandline-core/src/main/java/org/codelutin/option
Author: tchemit Date: 2008-07-25 21:36:09 +0000 (Fri, 25 Jul 2008) New Revision: 913 Modified: trunk/commandline/commandline-core/src/main/java/org/codelutin/option/Config.java Log: add a dynamic setProperty method using only the property's name to be used when we do not know real implementation of the Config Modified: trunk/commandline/commandline-core/src/main/java/org/codelutin/option/Config.java =================================================================== --- trunk/commandline/commandline-core/src/main/java/org/codelutin/option/Config.java 2008-07-25 21:34:18 UTC (rev 912) +++ trunk/commandline/commandline-core/src/main/java/org/codelutin/option/Config.java 2008-07-25 21:36:09 UTC (rev 913) @@ -524,6 +524,21 @@ } /** + * Set the value for a given property using his <code>def</code> key. + * + * @param def the given key to use + * @param value the given valuer to set + */ + public void setProperty(String def, Object value) { + ConfigPropertyKey<?> property = getKey(def); + if (property == null) { + throw new IllegalArgumentException("no property found with the key " + def); + } + setProperty(property, value); + + } + + /** * Set the value for a given property using his <code>def</code>. * * @param def the given key to use
participants (1)
-
tchemit@users.labs.libre-entreprise.org