| | |
| | | app.printVerboseMessage(msg); |
| | | |
| | | if (handler != null) { |
| | | for (PropertyEditorModification mod : editor.getModifications()) { |
| | | for (PropertyEditorModification<?> mod : editor.getModifications()) { |
| | | try { |
| | | Argument arg = createArgument(mod); |
| | | handler.getCommandBuilder().addArgument(arg); |
| | |
| | | * @return the argument representing the modification. |
| | | * @throws ArgumentException if there is a problem creating the argument. |
| | | */ |
| | | private static Argument createArgument(PropertyEditorModification mod) |
| | | private static <T> Argument createArgument(PropertyEditorModification<T> mod) |
| | | throws ArgumentException |
| | | { |
| | | StringArgument arg; |
| | | |
| | | String propName = mod.getPropertyDefinition().getName(); |
| | | PropertyDefinition<T> propertyDefinition = mod.getPropertyDefinition(); |
| | | String propName = propertyDefinition.getName(); |
| | | |
| | | switch (mod.getType()) |
| | | { |
| | |
| | | OPTION_DSCFG_SHORT_SET, OPTION_DSCFG_LONG_SET, false, true, true, |
| | | INFO_VALUE_SET_PLACEHOLDER.get(), null, null, |
| | | INFO_DSCFG_DESCRIPTION_PROP_VAL.get()); |
| | | for (Object value : mod.getModificationValues()) |
| | | for (T value : mod.getModificationValues()) |
| | | { |
| | | arg.addValue(propName+':'+getArgumentValue(value)); |
| | | arg.addValue(propName+':'+getArgumentValue(propertyDefinition, value)); |
| | | } |
| | | break; |
| | | case SET: |
| | |
| | | OPTION_DSCFG_SHORT_SET, OPTION_DSCFG_LONG_SET, false, true, true, |
| | | INFO_VALUE_SET_PLACEHOLDER.get(), null, null, |
| | | INFO_DSCFG_DESCRIPTION_PROP_VAL.get()); |
| | | for (Object value : mod.getModificationValues()) |
| | | for (T value : mod.getModificationValues()) |
| | | { |
| | | arg.addValue(propName+':'+getArgumentValue(value)); |
| | | arg.addValue(propName+':'+getArgumentValue(propertyDefinition, value)); |
| | | } |
| | | break; |
| | | case RESET: |
| | |
| | | null, OPTION_DSCFG_LONG_REMOVE, false, true, |
| | | true, INFO_VALUE_SET_PLACEHOLDER.get(), null, null, |
| | | INFO_DSCFG_DESCRIPTION_REMOVE_PROP_VAL.get()); |
| | | for (Object value : mod.getModificationValues()) |
| | | for (T value : mod.getModificationValues()) |
| | | { |
| | | arg.addValue(propName+':'+getArgumentValue(value)); |
| | | arg.addValue(propName+':'+getArgumentValue(propertyDefinition, value)); |
| | | } |
| | | arg = null; |
| | | break; |