/** * This is a property with a boolean value which defaults to false * * The user can 'turn this option on' by passing a command line switch without a value (e.g. -d ) in which case we need to * set the value to true * * @param property * @return true if this is a boolean switch property */ private boolean isBooleanSwitchProperty(ConfigurationProperty property) { return property.hasDefaults() && property.getDefaults().length == 1 && property.getDefaults()[0].equals("false"); }
public Map<ConfigurationProperty, List<String>> parseProperties(Map<ConfigurationProperty, List<String>> propertyMap, String... args) throws InterpreterPropertyException { for ( ConfigurationProperty p : getProperties()) { if ( p.hasDefaults()) { List<String> properties = getOrCreatePropertyList(propertyMap, p); Collections.addAll(properties, p.getDefaults()); } } return propertyMap; } }