import com.google.common.collect.ImmutableSet;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.binding.dom.codec.impl.NodeCodecContext.CodecContextFactory;
import org.opendaylight.mdsal.binding.runtime.api.AugmentRuntimeType;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.Item;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeWriterFactory;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingStreamEventWriter;
import org.opendaylight.mdsal.binding.dom.codec.api.CommonDataObjectCodecTreeNode;
-import org.opendaylight.mdsal.binding.dom.codec.impl.NodeCodecContext.CodecContextFactory;
import org.opendaylight.mdsal.binding.dom.codec.spi.AbstractBindingNormalizedNodeSerializer;
import org.opendaylight.mdsal.binding.dom.codec.spi.BindingDOMCodecServices;
import org.opendaylight.mdsal.binding.dom.codec.spi.BindingSchemaMapping;
*/
package org.opendaylight.mdsal.binding.dom.codec.impl;
-import org.opendaylight.mdsal.binding.dom.codec.impl.NodeCodecContext.CodecContextFactory;
import org.opendaylight.mdsal.binding.runtime.api.CaseRuntimeType;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
--- /dev/null
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.mdsal.binding.dom.codec.impl;
+
+import com.google.common.collect.ImmutableMap;
+import java.lang.reflect.Method;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.mdsal.binding.loader.BindingClassLoader;
+import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
+import org.opendaylight.mdsal.binding.runtime.api.ListRuntimeType;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+
+/**
+ * Immutable factory, which provides access to runtime context, create leaf nodes and provides path argument codecs.
+ *
+ * <p>
+ * During lifetime of factory all calls for same arguments to method must return equal result (not necessary same
+ * instance of result).
+ */
+sealed interface CodecContextFactory permits BindingCodecContext {
+ /**
+ * Returns immutable runtime context associated with this factory.
+ *
+ * @return runtime context
+ */
+ BindingRuntimeContext getRuntimeContext();
+
+ /**
+ * Returns leaf nodes for supplied data container and parent class.
+ *
+ * @param type Binding type for which leaves should be loaded.
+ * @param schema Instantiated schema of binding type.
+ * @return Map of local name to leaf node context.
+ */
+ ImmutableMap<Method, ValueNodeCodecContext> getLeafNodes(Class<?> type, EffectiveStatement<?, ?> schema);
+
+ /**
+ * Returns Path argument codec for list item.
+ *
+ * @param listClz Type of list item
+ * @param type Schema of list item
+ * @return Path argument codec for supplied list item.
+ */
+ IdentifiableItemCodec getPathArgumentCodec(Class<?> listClz, ListRuntimeType type);
+
+ /**
+ * Return the codec loader associated with this factory.
+ *
+ * @return A codec loader instance
+ */
+ @NonNull BindingClassLoader getLoader();
+
+ @NonNull DataObjectStreamer<?> getDataObjectSerializer(Class<?> type);
+
+ DataObjectSerializer getEventStreamSerializer(Class<?> type);
+}
import java.util.List;
import java.util.Map;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.binding.dom.codec.impl.NodeCodecContext.CodecContextFactory;
import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
import org.opendaylight.mdsal.binding.runtime.api.AugmentRuntimeType;
import org.opendaylight.mdsal.binding.runtime.api.AugmentableRuntimeType;
import java.lang.invoke.VarHandle;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.binding.dom.codec.api.CommonDataObjectCodecTreeNode.ChildAddressabilitySummary;
-import org.opendaylight.mdsal.binding.dom.codec.impl.NodeCodecContext.CodecContextFactory;
import org.opendaylight.mdsal.binding.runtime.api.CompositeRuntimeType;
import org.opendaylight.mdsal.binding.runtime.api.RuntimeType;
import org.opendaylight.mdsal.binding.runtime.api.RuntimeTypeContainer;
import static java.util.Objects.requireNonNull;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.mdsal.binding.dom.codec.impl.NodeCodecContext.CodecContextFactory;
import org.opendaylight.mdsal.binding.runtime.api.ChoiceRuntimeType;
import org.opendaylight.mdsal.binding.runtime.api.ContainerLikeRuntimeType;
import org.opendaylight.mdsal.binding.runtime.api.ContainerRuntimeType;
import net.bytebuddy.matcher.ElementMatchers;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingStreamEventWriter;
-import org.opendaylight.mdsal.binding.dom.codec.impl.NodeCodecContext.CodecContextFactory;
import org.opendaylight.mdsal.binding.dom.codec.spi.BindingSchemaMapping;
import org.opendaylight.mdsal.binding.loader.BindingClassLoader;
import org.opendaylight.mdsal.binding.loader.BindingClassLoader.ClassGenerator;
*/
package org.opendaylight.mdsal.binding.dom.codec.impl;
-import com.google.common.collect.ImmutableMap;
-import java.lang.reflect.Method;
-import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeNode;
-import org.opendaylight.mdsal.binding.loader.BindingClassLoader;
-import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
-import org.opendaylight.mdsal.binding.runtime.api.ListRuntimeType;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
/**
* Location specific context for schema nodes, which contains codec specific information to properly serialize
*/
protected abstract @Nullable NodeIdentifier getDomPathArgument();
- /**
- * Immutable factory, which provides access to runtime context, create leaf nodes and provides path argument codecs.
- *
- * <p>
- * During lifetime of factory all calls for same arguments to method must return equal result (not necessary same
- * instance of result).
- */
- protected interface CodecContextFactory {
- /**
- * Returns immutable runtime context associated with this factory.
- *
- * @return runtime context
- */
- BindingRuntimeContext getRuntimeContext();
-
- /**
- * Returns leaf nodes for supplied data container and parent class.
- *
- * @param type Binding type for which leaves should be loaded.
- * @param schema Instantiated schema of binding type.
- * @return Map of local name to leaf node context.
- */
- ImmutableMap<Method, ValueNodeCodecContext> getLeafNodes(Class<?> type, EffectiveStatement<?, ?> schema);
-
- /**
- * Returns Path argument codec for list item.
- *
- * @param listClz Type of list item
- * @param type Schema of list item
- * @return Path argument codec for supplied list item.
- */
- IdentifiableItemCodec getPathArgumentCodec(Class<?> listClz, ListRuntimeType type);
-
- /**
- * Return the codec loader associated with this factory.
- *
- * @return A codec loader instance
- */
- @NonNull BindingClassLoader getLoader();
-
- @NonNull DataObjectStreamer<?> getDataObjectSerializer(Class<?> type);
-
- DataObjectSerializer getEventStreamSerializer(Class<?> type);
- }
-
/**
* Return the default value object. Implementations of this method are explicitly allowed to throw unchecked
* exceptions, which are propagated as-is upwards the stack.