use of org.opendaylight.mdsal.binding.runtime.api.RuntimeType in project mdsal by opendaylight.
the class BindingRuntimeTypesFactory method indexModules.
private void indexModules(final Map<QNameModule, ModuleGenerator> moduleGens) {
for (var entry : moduleGens.entrySet()) {
final var modGen = entry.getValue();
// index the module's runtime type
safePut(modules, "modules", entry.getKey(), modGen.runtimeType().orElseThrow());
// index module's identities and RPC input/outputs
for (var gen : modGen) {
if (gen instanceof IdentityGenerator) {
((IdentityGenerator) gen).runtimeType().ifPresent(identity -> {
safePut(identities, "identities", identity.statement().argument(), identity);
});
}
// FIXME: do not collect these once we they generate a proper RuntimeType
if (gen instanceof RpcGenerator) {
final QName rpcName = ((RpcGenerator) gen).statement().argument();
for (var subgen : gen) {
if (subgen instanceof RpcInputGenerator) {
((RpcInputGenerator) subgen).runtimeType().ifPresent(input -> rpcInputs.put(rpcName, input));
} else if (subgen instanceof RpcOutputGenerator) {
((RpcOutputGenerator) subgen).runtimeType().ifPresent(output -> rpcOutputs.put(rpcName, output));
}
}
}
}
}
indexRuntimeTypes(moduleGens.values());
}
Aggregations