@Test public void testCanAggregateComponent() { assertEquals(AggregationType.AS_COMPLEX_PROPERTY, setter.computeAggregationType("door")); assertEquals(AggregationType.AS_BASIC_PROPERTY, setter.computeAggregationType("count")); assertEquals(AggregationType.AS_BASIC_PROPERTY, setter.computeAggregationType("Count")); assertEquals(AggregationType.AS_BASIC_PROPERTY, setter.computeAggregationType("name")); assertEquals(AggregationType.AS_BASIC_PROPERTY, setter.computeAggregationType("Name")); assertEquals(AggregationType.AS_BASIC_PROPERTY, setter.computeAggregationType("Duration")); assertEquals(AggregationType.AS_BASIC_PROPERTY, setter.computeAggregationType("fs")); assertEquals(AggregationType.AS_BASIC_PROPERTY, setter.computeAggregationType("open")); assertEquals(AggregationType.AS_BASIC_PROPERTY, setter.computeAggregationType("Open")); assertEquals(AggregationType.AS_COMPLEX_PROPERTY_COLLECTION, setter.computeAggregationType("Window")); assertEquals(AggregationType.AS_BASIC_PROPERTY_COLLECTION, setter.computeAggregationType("adjective")); assertEquals(AggregationType.AS_BASIC_PROPERTY, setter.computeAggregationType("filterReply")); assertEquals(AggregationType.AS_BASIC_PROPERTY, setter.computeAggregationType("houseColor")); }
public AggregationType computeAggregationType(String name) { String cName = capitalizeFirstLetter(name); Method addMethod = findAdderMethod(cName); if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; case AS_BASIC_PROPERTY_COLLECTION: case AS_COMPLEX_PROPERTY_COLLECTION: addError("Unexpected AggregationType " + type); } } Method setter = findSetterMethod(name); if (setter != null) { return computeRawAggregationType(setter); } else { return AggregationType.NOT_FOUND; } }
PropertySetter extends ContextAwareBase { public AggregationType computeAggregationType(String name) { String cName = capitalizeFirstLetter(name); Method addMethod = findAdderMethod(cName); if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; case AS_BASIC_PROPERTY_COLLECTION: case AS_COMPLEX_PROPERTY_COLLECTION: addError("Unexpected AggregationType " + type); } } Method setter = findSetterMethod(name); if (setter != null) { return computeRawAggregationType(setter); } else { return AggregationType.NOT_FOUND; } } }
PropertySetter extends ContextAwareBase { public AggregationType computeAggregationType(String name) { String cName = capitalizeFirstLetter(name); Method addMethod = findAdderMethod(cName); if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; case AS_BASIC_PROPERTY_COLLECTION: case AS_COMPLEX_PROPERTY_COLLECTION: addError("Unexpected AggregationType " + type); } } Method setter = findSetterMethod(name); if (setter != null) { return computeRawAggregationType(setter); } else { return AggregationType.NOT_FOUND; } } PropertySetter(BeanDescriptionCache beanDescriptionCache, Object obj); }
PropertySetter extends ContextAwareBase { public AggregationType computeAggregationType(String name) { String cName = capitalizeFirstLetter(name); Method addMethod = findAdderMethod(cName); if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; case AS_BASIC_PROPERTY_COLLECTION: case AS_COMPLEX_PROPERTY_COLLECTION: addError("Unexpected AggregationType " + type); } } Method setter = findSetterMethod(name); if (setter != null) { return computeRawAggregationType(setter); } else { return AggregationType.NOT_FOUND; } } PropertySetter(BeanDescriptionCache beanDescriptionCache, Object obj); void setProperty(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 AggregationType computeAggregationType(String name) { String cName = capitalizeFirstLetter(name); Method addMethod = findAdderMethod(cName); if (addMethod != null) { AggregationType type = computeRawAggregationType(addMethod); switch (type) { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; case AS_BASIC_PROPERTY_COLLECTION: case AS_COMPLEX_PROPERTY_COLLECTION: addError("Unexpected AggregationType " + type); } } Method setter = findSetterMethod(name); if (setter != null) { return computeRawAggregationType(setter); } else { return AggregationType.NOT_FOUND; } } PropertySetter(BeanDescriptionCache beanDescriptionCache, Object obj); void setProperty(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);  }