}
// Will be needed by XMappingConverter
context.put("xMappingResolver", xMappingResolver);
IXMappingSet xMappingSet = xMappingResolver.createMappingSet();
xMappingSet.setName(reader.getAttribute("name"));
xMappingSet.setFile(LocalFileSystem.getInstance().refreshAndFindFileByIoFile(srcFile));
xMappingSet.setVersion(reader.getAttribute("version"));
String priorityValue = reader.getAttribute("priority");
if (priorityValue != null)
{
try
{
xMappingSet.setPriority(Integer.parseInt(priorityValue));
}
catch (NumberFormatException e)
{
LOGGER.warn("Priority value should be an integer : <" + priorityValue + ">, in "
+ srcFile.getName());
}
}
context.put("xMappingSet", xMappingSet);
while (reader.hasMoreChildren())
{
reader.moveDown();
if ("supported-schemas".equals(reader.getNodeName()))
{
List supportedSchemas = (List) context.convertAnother(xMappingSet, List.class);
xMappingSet.setSupportedSchemas(supportedSchemas);
}
else if ("mappings".equals(reader.getNodeName()))
{
String skipValue = reader.getAttribute("defaultSkip");
xMappingSet.setDefaultSkipMode(XMappingFactoryXmlImpl.readSkipMode(skipValue));
List<IXMapping> mappings =
(List<IXMapping>) context.convertAnother(xMappingSet, List.class);
xMappingSet.setMappings(mappings);
}
reader.moveUp();
}
return xMappingSet;
}