- final WithStatus schema;
- if (stmt instanceof TypedDataSchemaNode) {
- schema = ((TypedDataSchemaNode) stmt).getType();
- } else if (stmt instanceof TypedefEffectiveStatement) {
- schema = ((TypedefEffectiveStatement) stmt).getTypeDefinition();
- } else if (stmt instanceof WithStatus) {
- schema = (WithStatus) stmt;
- } else {
- return;
+ // 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));
+ }
+ }
+ }