+ if (ctx.producesDeclared(SubmoduleStatement.class)) {
+ final Map<String, String> belongsTo = ctx.getAllFromNamespace(BelongsToPrefixToModuleName.class);
+ if (belongsTo != null) {
+ for (Entry<String, String> entry : belongsTo.entrySet()) {
+ final QNameModule module = ctx.getFromNamespace(ModuleNameToModuleQName.class, entry.getValue());
+ if (module != null && !additional.containsKey(entry.getKey())) {
+ additional.put(entry.getKey(), module);
+ }
+ }
+ }
+ }
+
+ this.prefixToModule = ImmutableMap.copyOf(additional);