for (Map.Entry<String, MetaDataObject> entry :
getDelegateAnalysisEngineSpecifiersWithImports().entrySet()) {
String key = entry.getKey();
keys.add(key);
if (entry.getValue() instanceof Import) {
Import aeImport = ((Import) entry.getValue());
// see if we processed this already
if (entry.getValue().equals(mProcessedImports.get(key))) {
continue;
}
// make sure Import's relative path base is set, to allow for
// users who create
// new import objects
if (aeImport instanceof Import_impl) {
((Import_impl) aeImport).setSourceUrlIfNull(this.getSourceUrl());
}
// locate import target
URL url = aeImport.findAbsoluteUrl(aResourceManager);
// check for resursive import
if (aEnclosingAggregateAeUrls.contains(url.toString())) {
String name = getMetaData() == null ? "<null>" : getMetaData().getName();
throw new InvalidXMLException(InvalidXMLException.CIRCULAR_AE_IMPORT, new Object[] {
name, url });
}
// parse import target
XMLInputSource input;
try {
input = new XMLInputSource(url);
} catch (IOException e) {
throw new InvalidXMLException(InvalidXMLException.IMPORT_FAILED_COULD_NOT_READ_FROM_URL,
new Object[] { url, aeImport.getSourceUrlString() }, e);
}
ResourceSpecifier spec = UIMAFramework.getXMLParser().parseResourceSpecifier(input);
// update entry in derived mDelegateAnalysisEngineSpecifiers map.
mDelegateAnalysisEngineSpecifiers.put(key, spec);