@Test public void testPropertyCollection() { setter.addBasicProperty("adjective", "nice"); setter.addBasicProperty("adjective", "big"); assertEquals(2, house.adjectiveList.size()); assertEquals("nice", house.adjectiveList.get(0)); assertEquals("big", house.adjectiveList.get(1)); }
public void addBasicProperty(String name, String strValue) { if (strValue == null) { return; } name = capitalizeFirstLetter(name); Method adderMethod = findAdderMethod(name); if (adderMethod == null) { addError("No adder for property [" + name + "]."); return; } Class<?>[] paramTypes = adderMethod.getParameterTypes(); isSanityCheckSuccessful(name, adderMethod, paramTypes, strValue); Object arg; try { arg = StringToObjectConverter.convertArg(this, strValue, paramTypes[0]); } catch (Throwable t) { addError("Conversion to type [" + paramTypes[0] + "] failed. ", t); return; } if (arg != null) { invokeMethodWithSingleParameterOnThisObject(adderMethod, strValue); } }
PropertySetter extends ContextAwareBase { public void addBasicProperty(String name, String strValue) { if (strValue == null) { return; } name = capitalizeFirstLetter(name); Method adderMethod = findAdderMethod(name); if (adderMethod == null) { addError("No adder for property [" + name + "]."); return; } Class<?>[] paramTypes = adderMethod.getParameterTypes(); isSanityCheckSuccessful(name, adderMethod, paramTypes, strValue); Object arg; try { arg = StringToObjectConverter.convertArg(this, strValue, paramTypes[0]); } catch (Throwable t) { addError("Conversion to type [" + paramTypes[0] + "] failed. ", t); return; } if (arg != null) { invokeMethodWithSingleParameterOnThisObject(adderMethod, strValue); } } }
PropertySetter extends ContextAwareBase { public void addBasicProperty(String name, String strValue) { if (strValue == null) { return; } name = capitalizeFirstLetter(name); Method adderMethod = findAdderMethod(name); if (adderMethod == null) { addError("No adder for property [" + name + "]."); return; } Class<?>[] paramTypes = adderMethod.getParameterTypes(); isSanityCheckSuccessful(name, adderMethod, paramTypes, strValue); Object arg; try { arg = StringToObjectConverter.convertArg(this, strValue, paramTypes[0]); } catch (Throwable t) { addError("Conversion to type [" + paramTypes[0] + "] failed. ", t); return; } if (arg != null) { invokeMethodWithSingleParameterOnThisObject(adderMethod, strValue); } } PropertySetter(Object obj); }
PropertySetter extends ContextAwareBase { public void addBasicProperty(String name, String strValue) { if (strValue == null) { return; } name = capitalizeFirstLetter(name); Method adderMethod = findAdderMethod(name); if (adderMethod == null) { addError("No adder for property [" + name + "]."); return; } Class<?>[] paramTypes = adderMethod.getParameterTypes(); isSanityCheckSuccessful(name, adderMethod, paramTypes, strValue); Object arg; try { arg = StringToObjectConverter.convertArg(this, strValue, paramTypes[0]); } catch (Throwable t) { addError("Conversion to type [" + paramTypes[0] + "] failed. ", t); return; } if (arg != null) { invokeMethodWithSingleParameterOnThisObject(adderMethod, strValue); } } PropertySetter(Object obj); void setProperty(String name, String value); void setProperty(PropertyDescriptor prop, String name, String value); AggregationType computeAggregationType(String name); Class<?> getObjClass(); void addComplexProperty(String name, Object complexProperty); void addBasicProperty(String name, String strValue); void setComplexProperty(String name, Object complexProperty); Object getObj(); Class<?> getClassNameViaImplicitRules(String name,
      AggregationType aggregationType, DefaultNestedComponentRegistry registry); }
PropertySetter extends ContextAwareBase { public void addBasicProperty(String name, String strValue) { if (strValue == null) { return; } name = capitalizeFirstLetter(name); Method adderMethod = findAdderMethod(name); if (adderMethod == null) { addError("No adder for property [" + name + "]."); return; } Class<?>[] paramTypes = adderMethod.getParameterTypes(); isSanityCheckSuccessful(name, adderMethod, paramTypes, strValue); Object arg; try { arg = StringToObjectConverter.convertArg(this, strValue, paramTypes[0]); } catch (Throwable t) { addError("Conversion to type [" + paramTypes[0] + "] failed. ", t); return; } if (arg != null) { invokeMethodWithSingleParameterOnThisObject(adderMethod, strValue); } } PropertySetter(Object obj); void setProperty(String name, String value); void setProperty(PropertyDescriptor prop, String name, String value); AggregationType computeAggregationType(String name); Class<?> getObjClass(); void addComplexProperty(String name, Object complexProperty); void addBasicProperty(String name, String strValue); void setComplexProperty(String name, Object complexProperty); Object getObj(); Class<?> getClassNameViaImplicitRules(String name,
      AggregationType aggregationType, DefaultNestedComponentRegistry registry);  }