private void initializeMappingsFromAnnotations() {
Map<ScanImporter, Class<?>> typeMap = ScannerTypeLoader.getMap();
for (Entry<ScanImporter, Class<?>> entry : typeMap.entrySet()) {
ScanImporter annotation = entry.getKey();
if (annotation.format() == ScanFormat.XML) {
boolean addedEntry = false;
if (annotation.startingXMLTags().length != 0) {
addToMap(annotation.scannerName(), annotation.startingXMLTags());
addedEntry = true;
} else if (annotation.startingXMLTagSets().length != 0) {
for (StartingTagSet startingTagSet : annotation.startingXMLTagSets()) {
if (startingTagSet.value().length != 0) {
addToMap(annotation.scannerName(), startingTagSet.value());
addedEntry = true;
}
}
}
assert addedEntry : "Failed to add an XML entry for scanner " + annotation.scannerName();
}
}
initialized = true;