private void createRootSerializers(List<XMLElementSerializationNode> graphs) {
Collection<Bean> beanModels = beanModelSet.getModels().values();
for(Bean model : beanModels) {
BeanInstanceCreator creator = model.getCreator();
SelectorStep[] selectorSteps = creator.getConfig().getSelectorSteps();
XMLElementSerializationNode createNode = (XMLElementSerializationNode) findNode(graphs, selectorSteps);
// Only create serializers for routed elements...
if(rootElementNames.contains(createNode.getQName())) {
createNode = ((XMLElementSerializationNode) createNode.clone());
createNode.setParent(null);
Class<?> beanClass = creator.getBeanRuntimeInfo().getPopulateType();
if(!Collection.class.isAssignableFrom(beanClass)) {
// Ignore Collections... don't allow them to be serialized.... not enough type info.
serializers.put(beanClass, new RootNodeSerializer(creator.getBeanId(), createNode));
addNamespaceAttributes(createNode);
}
}
}
}