- private DataContainerCodecPrototype<?> loadChildPrototype(final Class<? extends DataContainer> childClass) {
- 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());
- }
-
- // FIXME: MDSAL-697: move this method into BindingRuntimeContext
- // This method is only called from loadChildPrototype() and exists only to be overridden by
- // CaseNodeCodecContext. Since we are providing childClass and our schema to BindingRuntimeContext
- // and receiving childSchema from it via findChildSchemaDefinition, we should be able to receive
- // the equivalent of Map.Entry<Item, DataSchemaNode>, along with the override we create here. One
- // more input we may need to provide is our bindingClass().
- @SuppressWarnings("unchecked")
- Item<?> createBindingArg(final Class<?> childClass, final EffectiveStatement<?, ?> childSchema) {
- return Item.of((Class<? extends DataObject>) childClass);
- }
-
- private @Nullable DataContainerCodecPrototype<?> augmentationByClass(final @NonNull Class<?> childClass) {
- final DataContainerCodecPrototype<?> childProto = augmentationByStream.get(childClass);
- return childProto != null ? childProto : mismatchedAugmentationByClass(childClass);
- }
-
- private @Nullable DataContainerCodecPrototype<?> mismatchedAugmentationByClass(final @NonNull Class<?> childClass) {