template = new FreeMarkerTemplate(templateConfig);
}
public void write(Object bean, Writer writer, Model model) throws BeanRegistrationException, IOException {
Map<String, Object> templateContext = new HashMap<String, Object>();
BeanMetadata beanMetadata = model.getBeanMetadata(bean);
if(beanMetadata == null) {
BeanRegistrationException.throwUnregisteredBeanInstanceException(bean);
}
templateContext.put("bean", bean);
templateContext.put(MODEL_CTX_KEY, model);
templateContext.put("nsp", beanMetadata.getNamespacePrefix());
templateContext.put("writeNamespaces", writeNamespacesDirective);
templateContext.put("writeBean", writeBeanDirective);
templateContext.put("writePreText", writePreTextDirective);
templateContext.put("writeAttribs", writeAttribsDirective);