+ return new KeyedBuilder<>(new KeyStep<>(listItem, requireNonNull(caze), listKey));
+ }
+
+ public static <R extends DataRoot & DataObject, T extends ChildOf<? super R>>
+ @NonNull Builder<T> builderOfInherited(final Class<R> root, final Class<T> container) {
+ // FIXME: we are losing root identity, hence namespaces may not work correctly
+ return new RegularBuilder<>(createStep(container));
+ }
+
+ public static <R extends DataRoot & DataObject, C extends ChoiceIn<? super R> & DataObject,
+ T extends ChildOf<? super C>>
+ @NonNull Builder<T> builderOfInherited(final Class<R> root,
+ final Class<C> caze, final Class<T> container) {
+ // FIXME: we are losing root identity, hence namespaces may not work correctly
+ return new RegularBuilder<>(createStep(caze, container));
+ }
+
+ public static <R extends DataRoot & DataObject, N extends KeyAware<K> & ChildOf<? super R>,
+ K extends Key<N>>
+ @NonNull KeyedBuilder<N, K> builderOfInherited(final Class<R> root,
+ final Class<N> listItem, final K listKey) {
+ // FIXME: we are losing root identity, hence namespaces may not work correctly
+ return new KeyedBuilder<>(new KeyStep<>(listItem, listKey));
+ }
+
+ public static <R extends DataRoot & DataObject, C extends ChoiceIn<? super R> & DataObject,
+ N extends KeyAware<K> & ChildOf<? super C>, K extends Key<N>>
+ @NonNull KeyedBuilder<N, K> builderOfInherited(final Class<R> root,
+ final Class<C> caze, final Class<N> listItem, final K listKey) {
+ // FIXME: we are losing root identity, hence namespaces may not work correctly
+ return new KeyedBuilder<>(new KeyStep<>(listItem, requireNonNull(caze), listKey));
+ }
+
+ @Beta
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public static <T extends DataObject, C extends ChoiceIn<?> & DataObject> @NonNull DataObjectStep<T> createStep(
+ final Class<C> caze, final Class<T> type) {
+ return KeyAware.class.isAssignableFrom(type) ? new KeylessStep(type, caze) : new NodeStep<>(type, caze);
+ }
+
+ @Beta
+ public static <T extends DataObject> @NonNull DataObjectStep<T> createStep(final Class<T> type) {
+ return createStep(null, type);