+ checkArgument(arg == null);
+ return null;
+ }
+
+ @Override
+ public DataContainerCodecContext<?, ?> bindingPathArgumentChild(final InstanceIdentifier.PathArgument arg,
+ final List<PathArgument> builder) {
+ final java.util.Optional<? extends Class<? extends DataObject>> caseType = arg.getCaseType();
+ if (caseType.isPresent()) {
+ final Class<? extends DataObject> type = caseType.get();
+ final ChoiceNodeCodecContext<?> choice = choicesByClass.getUnchecked(type);
+ choice.addYangPathArgument(arg, builder);
+ final DataContainerCodecContext<?, ?> caze = choice.streamChild(type);
+ caze.addYangPathArgument(arg, builder);
+ return caze.bindingPathArgumentChild(arg, builder);
+ }
+
+ return super.bindingPathArgumentChild(arg, builder);
+ }
+
+ private static Class<?> findCaseChoice(final Class<? extends DataObject> caseClass) {
+ for (Type type : caseClass.getGenericInterfaces()) {
+ if (type instanceof Class) {
+ final Class<?> typeClass = (Class<?>) type;
+ if (ChoiceIn.class.isAssignableFrom(typeClass)) {
+ return typeClass.asSubclass(ChoiceIn.class);
+ }
+ }
+ }
+