use of org.dozer.loader.xml.MappingFileReader in project camel by apache.
the class DozerTypeConverterLoader method loadMappings.
private List<ClassMap> loadMappings(CamelContext camelContext, String mapperId, DozerBeanMapper mapper) {
List<ClassMap> answer = new ArrayList<ClassMap>();
// load the class map using the class resolver so we can load from classpath in OSGi
MappingFileReader reader = new MappingFileReader(XMLParserFactory.getInstance());
List<String> mappingFiles = mapper.getMappingFiles();
if (mappingFiles == null) {
return Collections.emptyList();
}
for (String name : mappingFiles) {
URL url = loadMappingFile(camelContext.getClassResolver(), name);
if (url != null) {
MappingFileData data = reader.read(url);
answer.addAll(data.getClassMaps());
}
}
return answer;
}
Aggregations