- final DataSchemaNode childSchema = childNonNull(
- factory().getRuntimeContext().findChildSchemaDefinition(getSchema(), namespace(), childClass), childClass,
- "Node %s does not have child named %s", getSchema(), childClass);
- return DataContainerCodecPrototype.from(createBindingArg(childClass, childSchema), childSchema, factory());
+ final var type = getType();
+ final var child = childNonNull(type.bindingChild(JavaTypeName.create(childClass)), childClass,
+ "Node %s does not have child named %s", type, childClass);
+
+ return DataContainerCodecPrototype.from(createBindingArg(childClass, child.statement()),
+ (CompositeRuntimeType) child, factory());