String propertyName = setting.getPropertyName();
if (logger.debugEnabled()) {
logger.debug("Writing property wiring code for '" + propertyName + "' of '" +
definition.getComponentType().getQualifiedSourceName() + "' bean class");
}
JProperty property = beanOracle.getProperty(propertyName);
if (property == null || !property.isMutable()) {
logger.error("Cannot set property '" + propertyName + "' on component '" +
componentClassName + "' in container. The property is missing or is read only");
throw new UnableToCompleteException();
}
Value value = setting.getValue();
String valueString = generateValueCode(value, logger, writer, oracle, typeOracle, property.getType(), nestedComponentDefinitions);
writer.println("component.set" + StringUtils.capitalize(property.getName()) + "(" + cast(valueString, property.getSetter().getParameters()[0].getType()) + ");");
}
writer.println("if (component instanceof ApplicationEventMulticasterAware) {");
writer.println(" ((ApplicationEventMulticasterAware) component).setApplicationEventMulticaster(__getApplicationEventMulticaster());");
writer.println("}");