return strict;
}
public void addVisitors(VisitorConfigMap visitorMap) {
if (bindBeanId != null && bindBeanClass != null) {
Bean bean;
if (fieldsInMessage) {
throw new SmooksConfigurationException("Unsupported reader based bean binding config. Not supported when fields are defined in message. See 'fieldsInMessage' attribute.");
}
if (vfRecordMetaData.isMultiTypeRecordSet()) {
throw new SmooksConfigurationException(
"Unsupported reader based bean binding config for a multi record type record set. "
+ "Only supported for single record type record sets. Use <jb:bean> configs for multi binding record type record sets.");
}
if (bindingType == BindingType.LIST) {
Bean listBean = new Bean(ArrayList.class, bindBeanId,
SmooksResourceConfiguration.DOCUMENT_FRAGMENT_SELECTOR);
bean = listBean.newBean(bindBeanClass, recordElementName);
listBean.bindTo(bean);
addFieldBindings(bean);
listBean.addVisitors(visitorMap);
} else if (bindingType == BindingType.MAP) {
if (bindMapKeyField == null) {
throw new SmooksConfigurationException(
"'MAP' Binding must specify a 'keyField' property on the binding configuration.");
}
vfRecordMetaData.getRecordMetaData().assertValidFieldName(bindMapKeyField);
Bean mapBean = new Bean(LinkedHashMap.class, bindBeanId,
SmooksResourceConfiguration.DOCUMENT_FRAGMENT_SELECTOR);
Bean recordBean = new Bean(bindBeanClass, RECORD_BEAN, recordElementName);
MapBindingWiringVisitor wiringVisitor = new MapBindingWiringVisitor(bindMapKeyField, bindBeanId);
addFieldBindings(recordBean);
mapBean.addVisitors(visitorMap);
recordBean.addVisitors(visitorMap);
visitorMap.addVisitor(wiringVisitor, recordElementName, null, false);
} else {
bean = new Bean(bindBeanClass, bindBeanId, recordElementName);
addFieldBindings(bean);
bean.addVisitors(visitorMap);
}
}